[{"data":1,"prerenderedAt":271},["ShallowReactive",2],{"post-\u002Fblog\u002F2023\u002Fmodbus-rj45-breakout":3},{"id":4,"title":5,"body":6,"categories":255,"date":259,"description":67,"extension":260,"image":261,"meta":262,"navigation":266,"path":267,"seo":268,"stem":269,"__hash__":270},"blog\u002Fblog\u002F2023\u002Fmodbus-rj45-breakout.md","Intensive Underground Metering - An RJ45 Breakout for Connecting Your Meters Through Ethernet Cabling",{"type":7,"value":8,"toc":248},"minimark",[9,13,16,53,56,59,62,69,74,79,84,87,96,99,104,113,118,127,130,201,204,209,212,217,222,225,229,244],[10,11,12],"p",{},"Again, I quickly developed a gadget to ease my life as a data collecting mole. ModBus adapters mostly have three drawbacks. Firstly, they have open wires, secondly, if you route them over RJ45, you waste many wires (ModBus usually needs 2-4 wires) and termination is a mess. OK, you can easily stick to Victron's solution, as their MK3 already has RJ45 as a plug, but still, you can not simply break out an RJ45 wire for meters, distributed accross your house.",[10,14,15],{},"Also, if you try to solve it with the common break out solutions for RJ45 e.g.,",[17,18,19,29,36,43,50],"ul",{},[20,21,22],"li",{},[23,24,28],"a",{"href":25,"rel":26},"https:\u002F\u002Fwww.reichelt.de\u002Frj45-buchse-terminalblock-hutschiene-delock-66992-p347936.html",[27],"nofollow","Delock 66992 (Reichelt)",[20,30,31],{},[23,32,35],{"href":33,"rel":34},"https:\u002F\u002Fwww.reichelt.de\u002Frj45-buchse-terminalblock-hutschiene-gewinkelt-delock-66993-p347937.html",[27],"Delock 66993 (Reichelt)",[20,37,38],{},[23,39,42],{"href":40,"rel":41},"https:\u002F\u002Fwww.reichelt.de\u002Fmodular-kupplung-rj45-buchse-terminalblock-delock-65527-p148849.html",[27],"Delock 65527 (Reichelt)",[20,44,45],{},[23,46,49],{"href":47,"rel":48},"https:\u002F\u002Fwww.reichelt.de\u002Frj45-buchse-terminalblock-mit-drucktaster-adapter-delock-66948-p327001.html",[27],"Delock 66948",[20,51,52],{},"and many more...",[10,54,55],{},"you will end up with an expensive, very fragile solution and still need to have a converter from USB to ModBus\u002FRS485, not speaking of termination.",[10,57,58],{},"The solution I want to present makes these challenges a bit more easy. It contains a dual USB-serial converter, isolated or non-isolated RS485 transceivers, jumpers for termination and many other assembly options. If you only populate the connectors (and a few chicken feed parts), you have a passive break out. If you populate a single transceiver and the wire connectors, you get mostly a default USB ModBus converter and if you populate everything, you have a gateway to your meter system.",[10,60,61],{},"And here are some of the pictures:",[10,63,64],{},[65,66],"img",{"alt":67,"src":68},"","\u002Fimages\u002Fblog\u002F2023\u002F06\u002FIMG_MBRJ45BO2_Full_Case_Open-1024x576.jpg",[10,70,71],{},[65,72],{"alt":67,"src":73},"\u002Fimages\u002Fblog\u002F2023\u002F06\u002FIMG_MBRJ45BO2_Full_Bottom-1024x780.jpg",[10,75,76],{},[65,77],{"alt":67,"src":78},"\u002Fimages\u002Fblog\u002F2023\u002F06\u002FIMG_MBRJ45BO2_Full_Case-1024x576.jpg",[80,81,83],"h3",{"id":82},"initial-bring-up-of-the-prototype","Initial Bring-Up of the Prototype",[10,85,86],{},"When bringing up the fully populated device, I realized, that I had two issues in the HW:",[88,89,90,93],"ol",{},[20,91,92],{},"The signals of the isolated RS485 transceiver have been swapped (A ↔ B)",[20,94,95],{},"The RX not-enable needs to be joined with TX enable for modbus clients\u002Fmasters to work properly, beacuse these SW seems not to be able to mask the bus echo, that happens on a half-duplex RS485 bus",[10,97,98],{},"A fixed version of pre-1.0.0 looks as follows :-)",[10,100,101],{},[65,102],{"alt":67,"src":103},"\u002Fimages\u002Fblog\u002F2023\u002F06\u002FIMG_MBRJ45BO2_Full_Case_Open-Fixed-1024x576.jpg",[10,105,106,107,112],{},"You can find all sources for the fixed board on ",[23,108,111],{"href":109,"rel":110},"https:\u002F\u002Fgithub.com\u002Fthe78mole\u002FModBus-RJ45-Breakout-2",[27],"GitHub"," as a KiCad project and also Gerber files for production.",[114,115,117],"h2",{"id":116},"the-software-sauce","The Software Sauce",[10,119,120,121,126],{},"To evaluate the functionality of the board, I connected a standard USB-RS485-converter to the same bus, where my breakout and a WAGO Energy Meter (MID) 879-3000, configured (using Bluetooth) to have the Bus ID 100 and a ModBus rate of 115200 Baud. For remotely accessing the USB-RS485-converter, I installed ser2net on a linux PC and made the serial interface available on a TCP port. As the terminal to access it, I used CoolTerm, since it is one of the few, that support connecting to a TCP serial without nasty Virtual COM port drivers (see my ",[23,122,125],{"href":123,"rel":124},"https:\u002F\u002Fthe78mole.de\u002Fthe-remote-serial-debugging-nightmare\u002F",[27],"post about serial debugging over network",").",[10,128,129],{},"When I now execute the following line on the linux device connected to my breakout board...",[131,132,136],"pre",{"className":133,"code":134,"language":135,"meta":67,"style":67},"language-bash shiki shiki-themes github-light github-dark","mbpoll -m rtu -P none -b 115200 -a 100 -t 4:hex -r 0x4001 -c 2 \u002Fdev\u002FttyUSB2 -v -1\n","bash",[137,138,139],"code",{"__ignoreMap":67},[140,141,144,148,152,156,159,162,165,168,171,174,177,180,183,186,189,192,195,198],"span",{"class":142,"line":143},"line",1,[140,145,147],{"class":146},"sScJk","mbpoll",[140,149,151],{"class":150},"sj4cs"," -m",[140,153,155],{"class":154},"sZZnC"," rtu",[140,157,158],{"class":150}," -P",[140,160,161],{"class":154}," none",[140,163,164],{"class":150}," -b",[140,166,167],{"class":150}," 115200",[140,169,170],{"class":150}," -a",[140,172,173],{"class":150}," 100",[140,175,176],{"class":150}," -t",[140,178,179],{"class":154}," 4:hex",[140,181,182],{"class":150}," -r",[140,184,185],{"class":150}," 0x4001",[140,187,188],{"class":150}," -c",[140,190,191],{"class":150}," 2",[140,193,194],{"class":154}," \u002Fdev\u002FttyUSB2",[140,196,197],{"class":150}," -v",[140,199,200],{"class":150}," -1\n",[10,202,203],{},"...I can see the response...",[10,205,206],{},[65,207],{"alt":67,"src":208},"\u002Fimages\u002Fblog\u002F2023\u002F06\u002Fimage.png",[10,210,211],{},"...and what the debug probe sees in CoolTerm...",[10,213,214],{},[65,215],{"alt":67,"src":216},"\u002Fimages\u002Fblog\u002F2023\u002F06\u002Fimage-1.png",[10,218,219,221],{},[137,220,147],{}," has some bug, I believe. If you request address 0x4000 with count 2, it will request 0x3FFF and 0x4000. This is, why in the examle above I requested 0x4001, to get the correct data of register 0x4000. I already added my 2 cents to an issue on the mbpoll Github project.",[223,224],"hr",{},[114,226,228],{"id":227},"kommentare-comments","Kommentare \u002F Comments",[10,230,231,232,237,238,243],{},"Hast du Fragen oder Anmerkungen zu diesem Artikel? ",[23,233,236],{"href":234,"rel":235},"https:\u002F\u002Fgithub.com\u002Fthe78mole-blog\u002Fthe78mole-blog.github.io\u002Fissues\u002Fnew?title=Kommentar+zu%3A+modbus-rj45-breakout&labels=comment",[27],"Erstelle ein GitHub Issue"," oder starte eine ",[23,239,242],{"href":240,"rel":241},"https:\u002F\u002Fgithub.com\u002Fthe78mole-blog\u002Fthe78mole-blog.github.io\u002Fdiscussions",[27],"Diskussion",".",[245,246,247],"style",{},"html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":67,"searchDepth":249,"depth":249,"links":250},2,[251,253,254],{"id":82,"depth":252,"text":83},3,{"id":116,"depth":249,"text":117},{"id":227,"depth":249,"text":228},[256,257,258],"Bus Systems","ModBus","Smart Home","2023-06-01","md","\u002Fimages\u002Fblog\u002F2023\u002F06\u002FMBRJ45BO2-Front.png",{"tags":263},[264,257,265],"Isolated ModBus","RS485",true,"\u002Fblog\u002F2023\u002Fmodbus-rj45-breakout",{"title":5,"description":67},"blog\u002F2023\u002Fmodbus-rj45-breakout","pwjMavDus0e1yvTdEGUZx-lm_SFhDoauBOxG4IBFRMM",1777286693571]