diff --git a/content/blog/wk4day1.md b/content/blog/wk4day1.md index bfe3fe7..8a55efe 100644 --- a/content/blog/wk4day1.md +++ b/content/blog/wk4day1.md @@ -1,7 +1,81 @@ --- -title: "Week 4, Monday:" +title: "Week 4, Monday: Modbus Failure" date: 2024-08-19T21:55:00+02:00 -draft: true --- {{< image frame="true" width="17em" float="right" src="/img/headline/zascatv.png" alt="Credit: Zasca TV, Youtube" >}} + +Geez I had some really bad luck today. So I bought what I thought was a perfectly normal modbus +ammeter, and I have the 32 channel variant with external current transformers. The microcontroller +boots and seems to blink an LED every 250ms or so as it's doing its measurements. The (chinese) +manual says it's a simple modbus device approachable via RS485 and it shows what all the 16 bit +registers are - relatively simple stuff. + +Yesterday I spent the day designing the physical parts, and today I thought I'd give a go to the +microcontroller firmware. I have written one of these before, but I seem to have ... misplaced the +source code for it. Not to worry, I remember it was a matter of connecting the ESP32 to the modbus, +and reading target address 1, and off to the races. Well, not today! + +I have eight of these units, one for each PDU. I connected one, but it was not responding on any +target address, and not with its default serial settings of `9600,8N1`, nor with any other +reasonable settings, nor on any other address. That's unfortunate. + +So I spend, what I can best describe as increasingly frustrating hours of debugging. First with +another ESP32, then with another RS485 unit, then by hotwiring the UART out of the RS485 converter +on the DIN module, and finally, and I say this after it turned 17:00 already, I grabbed the scope +and started taking a look at what was going over the modbus -- and I can clearly see the +differential (yellow is high while blue is low), but the DIN module is absolutely silent. I also +scoped the UART 3.3V, which is pulled to 2.8V by the board, but I can't see it saying anything +there, either. + +I connect the DIN module, via the hotwired GND, RX, TX, to my [[Bus +Pirate](https://buspirate.com/)], which, by the way, is any hardware tinkerer's dream. It allows me +to type simple commands in a terminal and talk to chips over 1-Wire, I2C, SPI, UART, and more. +This, normally anyway, allows me to figure out how a chip works before writing a as much as one +line of code. Neat! However, today, no dice. The DIN unit doesn't say -anything-, even when I send +it a perfectly normal probe, described in its manual. 💩 + +My blood pressure was rising and at around 17:30, after I think 8 hours of messing around and _not_ +finding out, I decided to give up for now. I went to Aliexpress and ordered a few alternative RS485 +dongles, including one for the PC itself, on USB, so that I can try to talk to the thing via my +Linux computer, _Summer_. Today has been almost completely written off :( + +### KVM-over-IP + +But there was one good thing, also! In the big bag'o'packages from yesterday, there was another +device: a NanoKVM from [[Sipeed](https://sipeed.com/nanokvm)]. This 40x40x40mm cube has a few USB +connectors, a HDMI connector, and an RJ45 ethernet connector. It's meant to be a KVM-over-IP device, +which can also emulate a USB CDROM, so that I can boot a specific ISO image that I uploaded to the +little machine. It runs Linux and has an (open) SSH server. I poke around on it, create a 'pim' +account, upload some SSH Keys, and close out password authentication. On IRC, my buddy _Habbie_ +mentions some security audit that was not overly optimistic about it - I take a look and conclude +that it's probably safe to run in _IPng Site Local_. + +The microcontroller boots up and gets an IPv4 address over DHCP, which it helpfully puts on a little +OLED display. The web interface is snappy and immediately shows _Summer_'s HDMI output at 1920x1080, +which I find impressive. I think this will be a perfect companion for when I'm on the road and need +an ersatz monitor. + +Marina makes dinner tonight - it's my sister's recipe called _Yolein-soep_, which is a tomato soup +made from concentrate and a white roux, with bacon bits, sjallots and rice. After the soup, she +serves two nice Flammkuchen, also with bacon and onions. It hits the spot after such a frustrating +day with RS485 and a non-working modbus. What am I doing wrong!? + +I decide to not think about it for the rest of the day, and watch some TV instead. I also go to bed +really early, at 22:00 I am already on one ear. + +## Pictures of the Day + +{{< gallery-category >}} + {{< gallery-photo fn="2024-08-19/IMG_0713.JPG" caption="The innards of the PDU are nicely placed in 3D printed parts." >}} + {{< gallery-photo fn="2024-08-19/IMG_0716.JPG" caption="The Rigol oscilloscope cannot see a problem with the differential RS485 signal." >}} + {{< gallery-photo fn="2024-08-19/IMG_0718.JPG" caption="I play around a little bit with the Sipeed NanoKVM" >}} + {{< gallery-photo fn="2024-08-19/IMG_0719.JPG" caption="The Sipeed NanoKVM shows a 1920x1080p picture from my Linux PC, Summer" >}} + {{< gallery-photo fn="2024-08-19/sipeed-kvm.png" caption="A screenshot of Summer's desktop as seen in a web browser, using Sipeed's NanoKVM over IP" >}} + {{< gallery-photo fn="2024-08-19/IMG_0720.JPG" caption="We eat Flammkuchen tonight, courtesy of Marina" >}} + {{< gallery-photo fn="2024-08-19/IMG_0721.JPG" caption="Leave your phone unattended, and there will be goofy pictures when you return..." >}} +{{< /gallery-category >}} + +{{< gallery-modal >}} +{{< gallery-script >}} + diff --git a/content/gallery.md b/content/gallery.md index e34c894..2bf883d 100644 --- a/content/gallery.md +++ b/content/gallery.md @@ -224,6 +224,20 @@ menu: {{< gallery-photo fn="2024-08-17/IMG_0700.JPG" caption="Quinn and I are making dinner - garlic soup and stuffed bellpepper" >}} {{< gallery-photo fn="2024-08-17/IMG_0702.JPG" caption="The finished product: 3 stuffed bellpeppers. Oone is buried,and some have grated cheese (I am not a fan)" >}} {{< gallery-photo fn="2024-08-17/IMG_0704.JPG" caption="We watch Wolverine and Deadpool tonight - it's a lighthearted flic, and I love it how they use the fourth wall" >}} + {{< gallery-photo fn="2024-08-19/IMG_0713.JPG" caption="A mostly finished PDU - with the ESP32-ETH01 in its own little box, and brackets that will hold the ammeter." >}} + {{< gallery-photo fn="2024-08-19/IMG_0714.JPG" caption="One side of the box will be green, the other red. This is to signify that there are two 220V C13 inputs each with their own 8 C14 plugs on the front." >}} + {{< gallery-photo fn="2024-08-18/fusion.png" caption="The fusion design - top right has what I call the floorplan, with the individual screw holes and pegs of the chassis. THe other things are the parts that go within." >}} + {{< gallery-photo fn="2024-08-18/IMG_0710.JPG" caption="We watched Jared Leto and Jennifer Connelley in Requiem for a Dream." >}} + {{< gallery-photo fn="2024-08-18/IMG_0711.JPG" caption="The two loaves of bread baked themselves on a timer!" >}} + {{< gallery-photo fn="2024-08-18/IMG_0712.JPG" caption="Another tray of parts is freshly printed in black PLA. I will need to make eight batches of these." >}} + {{< gallery-photo fn="2024-08-19/IMG_0713.JPG" caption="The innards of the PDU are nicely placed in 3D printed parts." >}} + {{< gallery-photo fn="2024-08-19/IMG_0716.JPG" caption="The Rigol oscilloscope cannot see a problem with the differential RS485 signal." >}} + {{< gallery-photo fn="2024-08-19/IMG_0718.JPG" caption="I play around a little bit with the Sipeed NanoKVM" >}} + {{< gallery-photo fn="2024-08-19/IMG_0719.JPG" caption="The Sipeed NanoKVM shows a 1920x1080p picture from my Linux PC, Summer" >}} + {{< gallery-photo fn="2024-08-19/sipeed-kvm.png" caption="A screenshot of Summer's desktop as seen in a web browser, using Sipeed's NanoKVM over IP" >}} + {{< gallery-photo fn="2024-08-19/IMG_0720.JPG" caption="We eat Flammkuchen tonight, courtesy of Marina" >}} + {{< gallery-photo fn="2024-08-19/IMG_0721.JPG" caption="Leave your phone unattended, and there will be goofy pictures when you return..." >}} + {{< /gallery-category >}} ### Playing with OBS sound (August 8th) diff --git a/static/img/fullsize/2024-08-19/IMG_0716.JPG b/static/img/fullsize/2024-08-19/IMG_0716.JPG new file mode 100644 index 0000000..3be17bc --- /dev/null +++ b/static/img/fullsize/2024-08-19/IMG_0716.JPG @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e22b08379ed8fd53d624a355dcdf4ee48a1067e3b105927e510a0841404601ea +size 1141918 diff --git a/static/img/fullsize/2024-08-19/IMG_0718.JPG b/static/img/fullsize/2024-08-19/IMG_0718.JPG new file mode 100644 index 0000000..191a783 --- /dev/null +++ b/static/img/fullsize/2024-08-19/IMG_0718.JPG @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:131f01d2b61154bc7e8a9cd2344054339c77f0e18e6d34fa85028a2d0dd679db +size 773650 diff --git a/static/img/fullsize/2024-08-19/IMG_0719.JPG b/static/img/fullsize/2024-08-19/IMG_0719.JPG new file mode 100644 index 0000000..49b2c08 --- /dev/null +++ b/static/img/fullsize/2024-08-19/IMG_0719.JPG @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:31f0669b862f701af18c4ca0763d753e451f108e5a23ee6cfd8edc0433d90ead +size 1073206 diff --git a/static/img/fullsize/2024-08-19/IMG_0720.JPG b/static/img/fullsize/2024-08-19/IMG_0720.JPG new file mode 100644 index 0000000..9c02543 --- /dev/null +++ b/static/img/fullsize/2024-08-19/IMG_0720.JPG @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a5253006c3e3a4d9f2e2bf243200dfcfe65579538d69c1db540159b1a7891703 +size 1300922 diff --git a/static/img/fullsize/2024-08-19/IMG_0721.JPG b/static/img/fullsize/2024-08-19/IMG_0721.JPG new file mode 100644 index 0000000..bb29814 --- /dev/null +++ b/static/img/fullsize/2024-08-19/IMG_0721.JPG @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c41608825baa0eaef8ff454a44990f79ba09170102b8d26bea693681f09afe6a +size 883504 diff --git a/static/img/fullsize/2024-08-19/sipeed-kvm.png b/static/img/fullsize/2024-08-19/sipeed-kvm.png new file mode 100644 index 0000000..d4d37a5 --- /dev/null +++ b/static/img/fullsize/2024-08-19/sipeed-kvm.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e05d3c6a8093f735ef274585cc1143f9abb53cc0dc776319ff6d54da42db1855 +size 1047492 diff --git a/static/img/thumbnails/2024-08-19/IMG_0716.JPG b/static/img/thumbnails/2024-08-19/IMG_0716.JPG new file mode 100644 index 0000000..c9f4040 --- /dev/null +++ b/static/img/thumbnails/2024-08-19/IMG_0716.JPG @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5fbe8f2a820d1bf6999d5d3d2d833b366466c93b2338b9e10e190fff2d86ef70 +size 43437 diff --git a/static/img/thumbnails/2024-08-19/IMG_0718.JPG b/static/img/thumbnails/2024-08-19/IMG_0718.JPG new file mode 100644 index 0000000..f6ae32d --- /dev/null +++ b/static/img/thumbnails/2024-08-19/IMG_0718.JPG @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fb15b16a61838c55e93297d9be0129e9f5b99df106f7e0e3b386d5d90bf0450d +size 32854 diff --git a/static/img/thumbnails/2024-08-19/IMG_0719.JPG b/static/img/thumbnails/2024-08-19/IMG_0719.JPG new file mode 100644 index 0000000..27ce06d --- /dev/null +++ b/static/img/thumbnails/2024-08-19/IMG_0719.JPG @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2cc2ce533a6b7e9f31fa50485bc8f2cb64340ebcb87715f1f8c919a4194674cf +size 36542 diff --git a/static/img/thumbnails/2024-08-19/IMG_0720.JPG b/static/img/thumbnails/2024-08-19/IMG_0720.JPG new file mode 100644 index 0000000..1616fae --- /dev/null +++ b/static/img/thumbnails/2024-08-19/IMG_0720.JPG @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7abd8f6fe047473f1f2e640b75cf02bab14dde0e6bd101d9d2907ddb254bd31d +size 34598 diff --git a/static/img/thumbnails/2024-08-19/IMG_0721.JPG b/static/img/thumbnails/2024-08-19/IMG_0721.JPG new file mode 100644 index 0000000..f509b13 --- /dev/null +++ b/static/img/thumbnails/2024-08-19/IMG_0721.JPG @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:66afc0448bef6a72d847f0b92435ad1e36af644cbc861f764a0cc66fe26d3f51 +size 24198 diff --git a/static/img/thumbnails/2024-08-19/sipeed-kvm.png b/static/img/thumbnails/2024-08-19/sipeed-kvm.png new file mode 100644 index 0000000..0c4babe --- /dev/null +++ b/static/img/thumbnails/2024-08-19/sipeed-kvm.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d903265455ad6a7b536e57afc98911900c71116d21f54c8c2a5a65073f8ee811 +size 54163