diy solar

diy solar

Announcing wombatt -- monitoring batteries and inverters

You have to use a Tasmota image that supports the TCP Serial bridge, then configure the module to something like the image below (depending on what device you use, GPIOs might be different):

Screenshot from 2024-05-28 11-39-29.png
If your Tasmota image does not support the TCP serial bridge, "TCP Tx" and "TCP Rx" won't be available as options for GPIOs.

Then in the tasmota console run the lines below, and reboot the device:
Code:
Rule1 ON Http#Initialized DO TCPStart 8232 ENDON
Rule1 1

The first line tells Tasmota to start the TCP-Serial bridge after the HTTP port is initialized. The second one enables the rule. These settings will persist if the device reboots.

In my case, I run a DNS server to translate from device name to IP address. If providing the name does not work for you, try the device IP, and make sure to pin the IP address to the device so it does not change in the future.
 
You have to use a Tasmota image that supports the TCP Serial bridge, then configure the module to something like the image below (depending on what device you use, GPIOs might be different):

View attachment 218215
If your Tasmota image does not support the TCP serial bridge, "TCP Tx" and "TCP Rx" won't be available as options for GPIOs.

Then in the tasmota console run the lines below, and reboot the device:
Code:
Rule1 ON Http#Initialized DO TCPStart 8232 ENDON
Rule1 1

The first line tells Tasmota to start the TCP-Serial bridge after the HTTP port is initialized. The second one enables the rule. These settings will persist if the device reboots.

In my case, I run a DNS server to translate from device name to IP address. If providing the name does not work for you, try the device IP, and make sure to pin the IP address to the device so it does not change in the future.
OK, thank you, now it's opening (I'm using the IP for now) but the commands are timing out:
2024/05/28 21:19:37.590518 timed out sending Q1
2024/05/28 21:19:37.590672 timed out sending QPIGS
2024/05/28 21:19:37.590700 timed out sending QPIRI
2024/05/28 21:19:37.590721 timed out sending QPGS2

I upgraded the image based off the tasmota32-zbbrdgpro.bin as per the tasmota doc stating: TCP Serial Bridge "This feature is included only in tasmota-zbbridge and tasmota-zbbrdgpro binaries"

Then updated the template to the M5Stack Atom Lite:
{"NAME":"M5Stack Atom Lite","GPIO":[1,1,1,1,1,1,1,1,1056,1,1,1,1,1,1,1,0,1,1,1,0,1,640,1376,0,0,0,0,608,1,1,1,1,0,0,32],"FLAG":0,"BASE":1}

also have the TCP-Serial bridge after the HTTP port initialized:
00:00:04.604 RUL: HTTP#INITIALIZED performs 'TCPStart 8232'
00:00:04.606 TCP: Starting TCP server on port 8232
00:00:04.608 RSL: RESULT = {"TCPStart":"Done"}
22:14:45.571 MQT: Attempting connection...
22:14:45.591 MQT: Connected

and have pins 19 and 22 set to TCP Tx and TCP Rx, accordingly.

When I made my cable, I used the rj45 to rs232 cable SS sent me with the inverter, checked continuity to find which wire color went to which pin on the rs232, then soldered same color wire to the rs232 terminal adapter pin I only used GND TX and RX like you showed in your picture: (I'm using these rs232 ) and am running the same isolators you gave the link to in the other thread.

I also have the RED Tx wire going into the Rx port of the ATOMIC RS232 Base, and the WHITE Rx wire going into the Tx port of the ATOMIC RS232 Base like you have in your picture...I assume you soldered the RED wire to Tx in your rs232 DB9 Terminal Adapter and WHITE to Rx maintaining what the rj45 to rs232 cable from SS was doing.

Do you have any other idea I could try?

When I launch the monitor-inverters command, I get a Got Connection entry in the console on the Atom...the IP is not the IP of the OrangePi or MQTT Mosquitto broker running in HA, it's a different IP, but then nothing happens, and the timeouts happen on the other end (OrangePi Docker Container).

Do I have to setup a listener conf file in the Mosquitto broker like how is done for the Solar Assistant Docker Bridge?
...with a topic # in setting set so the mqtt broker will receive the response from the commands?

EDIT: tried setting up a listener conf file and still commands time out and nothing is sent to the HA mqtt broker, unless I am not looking in the right place.
 
Last edited:
The commands timing out is an RS232 issue. I think it's most likely that RX and TX are swapped.

I'm using these connectors from Amazon and the wires look like:
DB9-to-RS232base.jpg

I.e., RX from the connector to TX in the RS232 base, TX from the connector to RX in the RS232 base, and GND to GND.

Once there are no port timeouts, you probably need a new user/password for MQTT. I think mosquitto, by default, will only allow one connection per user.
 
swapped them, same result, timed out. I thought pin#2 on the connector is Tx? After the isolator, does it reverse them? Maybe I have my soldering not correct.

wouldn't the response from the commands go to the mqtt as a topic? Maybe I don't have my mqtt broker setup correctly to listen to the topic specified on the atom and in the commands...i'll try that.
 
Last edited:
swapped them, same result, timed out. I thought pin#2 on the connector is Tx? After the isolator, does it reverse them? Maybe I have my soldering not correct.
These connections are *after* the isolator.
wouldn't the response from the commands go to the mqtt as a topic? Maybe I don't have my mqtt broker setup correctly to listen to the topic specified on the atom and in the commands...i'll try that.

If you're still getting the timeouts, all you will see in the MQTT server logs is a connection but nothing will be sent over it.
 
These connections are *after* the isolator.


If you're still getting the timeouts, all you will see in the MQTT server logs is a connection but nothing will be sent over it.
Ok, I double checked my wires and I should have them correct.
In connecting a scope to the Tx wire on the RS232 Base on the Atom and running these two commands I get the following:

when I run monitor-inverters with only Q1
1 command.png

monitor-inverters with Q1:QPIGS:QPIRI:QPGS2
4 commands.png

The two images look identical. I'm very new to using my scope and hope I have it configured properly, but this is the single trigger capture. It's my understanding the GPIO pin should jump to 3.3v on Tx on the Atom, so maybe this signal is only the Opening Connection command before the "Q" commands are sent.
 
Ok, I double checked my wires and I should have them correct.
In connecting a scope to the Tx wire on the RS232 Base on the Atom and running these two commands I get the following:

when I run monitor-inverters with only Q1
View attachment 218402

monitor-inverters with Q1:QPIGS:QPIRI:QPGS2
View attachment 218403

The two images look identical. I'm very new to using my scope and hope I have it configured properly, but this is the single trigger capture. It's my understanding the GPIO pin should jump to 3.3v on Tx on the Atom, so maybe this signal is only the Opening Connection command before the "Q" commands are sent.
Is the inverter connected? The inverter has the DSR pin active and that might affect how everything works.
Ok, I double checked my wires and I should have them correct.
In connecting a scope to the Tx wire on the RS232 Base on the Atom and running these two commands I get the following:

when I run monitor-inverters with only Q1
View attachment 218402

monitor-inverters with Q1:QPIGS:QPIRI:QPGS2
View attachment 218403

The two images look identical. I'm very new to using my scope and hope I have it configured properly, but this is the single trigger capture. It's my understanding the GPIO pin should jump to 3.3v on Tx on the Atom, so maybe this signal is only the Opening Connection command before the "Q" commands are sent.
They probably look identical because wombatt is waiting for the reply to Q1. If you wait a few seconds (5s by default) you should see the next command being sent. Either way, this means the commands are being sent. Do you get anything on the RX wire (TX in the inverter)?
 
Is the inverter connected? The inverter has the DSR pin active and that might affect how everything works.

They probably look identical because wombatt is waiting for the reply to Q1. If you wait a few seconds (5s by default) you should see the next command being sent. Either way, this means the commands are being sent. Do you get anything on the RX wire (TX in the inverter)?
I didn't have it connected to the inverter when I scoped it.

I'm going to try and debug the mqtt part of this...I'm wondering if I don't have something setup right in the mqtt, maybe try it without the mqtt par of the command.

Getting same timeout running commands without the mqtt part. Maybe it's how I installed your image in a docker container. I cannot cd into the container and run wombatt, it tells me wombatt command not found. I always have to run: docker run gonzalomono/wombatt:v0.0.6 monitor-inverters which ends up creating a new container in portainer, I then delete because on each run, it creates a new one. I figured I'd deal with running the command later once I got one command working...I don't really understand how docker and containers work. I simply created a container with a docker-compose.yaml file, gave it the image location you specified:
docker.io/gonzalomono/wombatt:v0.0.6
mounted a volume:
volumes:
- /opt/wonbatt:/wonbatt
I couldn't mount a volume named wombatt because I got an error saying:
Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/opt/wombatt" to rootfs at "/wombatt": mount /opt/wombatt:/wombatt (via /proc/self/fd/6), flags: 0x5000: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type

so I named the volume wonbatt instead of wombatt, then I could run: docker run gonzalomono/wombatt:v0.0.6 monitor-inverters, but again it would create a new container per run.
 
Last edited:
The docker images are created with 'ENTRYPOINT["/wombatt"]' so the binary is at the root. This is why /wombatt as a mountpoint does not work.

You could try running:
Bash:
docker exec -it <runningimageID> /bin/bash
or /bin/sh if that fails. That way you can inspect what's in /dev and whether the serial ports are accessible.
 
The docker images are created with 'ENTRYPOINT["/wombatt"]' so the binary is at the root. This is why /wombatt as a mountpoint does not work.

You could try running:
Bash:
docker exec -it <runningimageID> /bin/bash
or /bin/sh if that fails. That way you can inspect what's in /dev and whether the serial ports are accessible.
I can't get the wombatt container to run, it always exits with code 1, and in log states:
Usage: wombatt <command>
A wanna-be Swiss army knife for inverter and battery monitoring.
Flags:
-h, --help Show context-sensitive help.
-l, --log-level="info" Set the logging level (debug|info|warn|error)
-v, --version Print version information and quit

:
battery-info --address=STRING --battery-ids=BATTERY-IDS,...
Displays battery information
wombatt: error: expected one of "battery-info", "forward", "inverter-query", "modbus-read", "monitor-batteries", ...
forward --controller-port=STRING --subordinate-port=STRING
Forwards commands between a two devices
inverter-query --address=ADDRESS,... --command=COMMAND,...
Sends PI30 protocol commands to inverters
modbus-read --address=STRING --id=UINT-8 --start=UINT-16 --count=UINT-8
Reads Modbus holding registers
monitor-batteries --address=STRING --battery-id=BATTERY-ID,...
Monitors batteries state, MQTT publishing optional
monitor-inverters <monitors> ...
Monitors inverters using PI30 protocol, MQTT publishing optional
Run "wombatt <command> --help" for more information on a command.
 
I've uploaded a new docker image tagged "debug" that uses CMD instead of ENTRYPOINT. With this image, the "docker exec -it ...." I provided earlier should work, but I haven't tested it.
 
I've uploaded a new docker image tagged "debug" that uses CMD instead of ENTRYPOINT. With this image, the "docker exec -it ...." I provided earlier should work, but I haven't tested it.
Thank you. Sorry to put you through the trouble.

OK I got:
docker run -it --privileged gonzalomono/wombatt:debug /bin/sh
to successfully run a container and open a bash shell...tried monitor inverters and got same time out...then tried this
/dev $ dmesg | grep tty
[ 0.000000] Kernel command line: root=UUID=5ce619d5-0a9b-4295-8436-014d19a33fb6 rootwait rootfstype=ext4 console=ttyS0,115200 console=tty1 consoleblank=0 loglevel=1 ubootpart=85bf36e3-01 usb-storage.quirks=0x2537:0x1066:u,0x2537:0x1068:u cgroup_enable=memory swapaccount=1
[ 0.000626] printk: console [tty1] enabled
[ 2.510888] printk: console [ttyS0] disabled
[ 2.510994] 5000000.serial: ttyS0 at MMIO 0x5000000 (irq = 35, base_baud = 1500000) is a 16550A
[ 2.511210] printk: console [ttyS0] enabled
[ 6.708676] systemd[1]: Created slice system-getty.slice.
[ 6.713785] systemd[1]: Created slice system-serial\x2dgetty.slice.
[ 6.962435] mtty_probe init device addr: 0x000000008773b081
[ 8.125887] systemd[1]: Found device /dev/ttyS0.
[ 14.815956] mtty_open device success!

I'm not sure what that means.
OK, after reading I think this serial port is available: /dev/ttyS0

tried
/wombatt monitor-inverters /dev/ttyS0,Q1:QPIGS:QPIRI,eg4_1
got before canceling
time=2024-05-30T12:21:29.963Z level=INFO msg="error opening /dev/ttyS0: error opening '/dev/ttyS0': Permission denied"
time=2024-05-30T12:21:29.963Z level=INFO msg="error running Q1 on /dev/ttyS0: error opening '/dev/ttyS0': Permission denied"
 
Last edited:
Thank you. Sorry to put you through the trouble.

OK I got:
docker run -it --privileged gonzalomono/wombatt:debug /bin/sh
to successfully run a container and open a bash shell...tried monitor inverters and got same time out...then tried this
/dev $ dmesg | grep tty
[ 0.000000] Kernel command line: root=UUID=5ce619d5-0a9b-4295-8436-014d19a33fb6 rootwait rootfstype=ext4 console=ttyS0,115200 console=tty1 consoleblank=0 loglevel=1 ubootpart=85bf36e3-01 usb-storage.quirks=0x2537:0x1066:u,0x2537:0x1068:u cgroup_enable=memory swapaccount=1
[ 0.000626] printk: console [tty1] enabled
[ 2.510888] printk: console [ttyS0] disabled
[ 2.510994] 5000000.serial: ttyS0 at MMIO 0x5000000 (irq = 35, base_baud = 1500000) is a 16550A
[ 2.511210] printk: console [ttyS0] enabled
[ 6.708676] systemd[1]: Created slice system-getty.slice.
[ 6.713785] systemd[1]: Created slice system-serial\x2dgetty.slice.
[ 6.962435] mtty_probe init device addr: 0x000000008773b081
[ 8.125887] systemd[1]: Found device /dev/ttyS0.
[ 14.815956] mtty_open device success!

I'm not sure what that means.
OK, after reading I think this serial port is available: /dev/ttyS0

tried
/wombatt monitor-inverters /dev/ttyS0,Q1:QPIGS:QPIRI,eg4_1
got before canceling
time=2024-05-30T12:21:29.963Z level=INFO msg="error opening /dev/ttyS0: error opening '/dev/ttyS0': Permission denied"
time=2024-05-30T12:21:29.963Z level=INFO msg="error running Q1 on /dev/ttyS0: error opening '/dev/ttyS0': Permission denied"
What's the ownership of /dev/ttyS0? With ENTRY POINT the user is set to 'wombat' and group to 'dialout'. For the sake of testing, change the mode of /dev/tryS0 to 666 (chmod 666 /dev/ttyS0) and that should fix the permission denied problem.
 
What's the ownership of /dev/ttyS0? With ENTRY POINT the user is set to 'wombat' and group to 'dialout'. For the sake of testing, change the mode of /dev/tryS0 to 666 (chmod 666 /dev/ttyS0) and that should fix the permission denied problem.
ls -l /dev/ttyS0
crw--w---- 1 root tty 4, 64 May 30 19:44 /dev/ttyS0

so root owns the tty...

I can't seem to change the mode of /dev/ttyS0.

/dev $ chmod 666 /dev/ttyS0
chmod: /dev/ttyS0: Operation not permitted

chown wombatt /dev/ttyS0
chown: /dev/ttyS0: Operation not permitted

Only way I can get a wombatt container to run is with a non-interactive shell where wombatt doesn't have permission and I cannot run any docker commands inside the running container to try and change any ownership....I'm a little stuck.
 
Last edited:
ls -l /dev/ttyS0
crw--w---- 1 root tty 4, 64 May 30 19:44 /dev/ttyS0

so root owns the tty...

I can't seem to change the mode of /dev/ttyS0.

/dev $ chmod 666 /dev/ttyS0
chmod: /dev/ttyS0: Operation not permitted

chown wombatt /dev/ttyS0
chown: /dev/ttyS0: Operation not permitted

Only way I can get a wombatt container to run is with a non-interactive shell where wombatt doesn't have permission and I cannot run any docker commands inside the running container to try and change any ownership....I'm a little stuck.
The device refers to the host device. Perhaps changing the permissions of /dev/ttyS0 on the host machine fixes it. You can also try running wombatt outside of the container and go from there.
 
The device refers to the host device. Perhaps changing the permissions of /dev/ttyS0 on the host machine fixes it. You can also try running wombatt outside of the container and go from there.
Thanks, I was thinking the same thing, I'd just have to redesign my configuration. I currently have it installed on an OrangePi which runs a pi-hole for my wifi, then HA runs inside a docker container amongst other things like esphome, mqtt mosquito, and now wombatt within there own containers.

I was curious, since you made available the docker images, were you able to run wombatt in a docker container?
 
Thanks, I was thinking the same thing, I'd just have to redesign my configuration. I currently have it installed on an OrangePi which runs a pi-hole for my wifi, then HA runs inside a docker container amongst other things like esphome, mqtt mosquito, and now wombatt within there own containers.

I was curious, since you made available the docker images, were you able to run wombatt in a docker container?
Yes, it works fine for me using ENTRYPOINT and setting the user to wombatt:dialout. I normally run it from the terminal, but should add a systemd service for it and upload the config to the repo.
 
What's the ownership of /dev/ttyS0? With ENTRY POINT the user is set to 'wombat' and group to 'dialout'. For the sake of testing, change the mode of /dev/tryS0 to 666 (chmod 666 /dev/ttyS0) and that should fix the permission denied problem.
After studying docker containers a bit more (I really should stop jumping in the deep end before learning how to swim) I was able to work some of this out.

First launching wombatt with the proper commands in the compose.yaml file so the container did not stop, but runs. Right now I am running it without the mqqt:
command: ["monitor-inverters", "192.168.1.166:8232,Q1", "--device-type tcp"]

this keeps the container running and I get the following in the log.
2024/05/31 12:15:09.631879 Opening 192.168.1.166:8232...
2024/05/31 12:15:15.070637 error running Q1 on 192.168.1.166:8232: timed out sending Q1
2024/05/31 12:15:25.070932 Opening 192.168.1.166:8232...
2024/05/31 12:15:30.127100 error running Q1 on 192.168.1.166:8232: timed out sending Q1
2024/05/31 12:15:40.136516 Opening 192.168.1.166:8232...
2024/05/31 12:15:45.182413 error running Q1 on id username:8232: timed out sending Q1

I misunderstood setting the permissions of /dev/ttyS0, which I thought had to be done by the user inside the container, but I was able to change them outside the container with sudo...but sadly this didn't work.

Something interesting I tried, pinging the ip of the atom (id username) from within the container gave this:
ping: permission denied (are you root?)
then I tried setting the user to root when the container was created and then I could ping the Atom. But the Q1 command still timed out.
 
Last edited:
Is the inverter connected? The inverter has the DSR pin active and that might affect how everything works.

They probably look identical because wombatt is waiting for the reply to Q1. If you wait a few seconds (5s by default) you should see the next command being sent. Either way, this means the commands are being sent. Do you get anything on the RX wire (TX in the inverter)?
I'm going to go back to this. At this point, I got a connection from the container running wombatt to the Atom (confirmed in the Atom log Got Connection...), and the scope showed the command sent on the Tx wire on the RS232 base. I'll try and scope the Rx wire (Tx in the inverter) and see if I get any signal.

As a baseline test, this is what I am getting not connected to the inverter, no isolator, right from the rs232 base. Channel 1 is connected to the R on the rs232 base, and Channel 2 is connected to the T on the rs232 base. The voltages on rs232, from what I've read here:
"By the RS-232 standard a logic high ('1') is represented by a negative voltage – anywhere from -3 to -25V – while a logic low ('0') transmits a positive voltage that can be anywhere from +3 to +25V."
rs232.png

after the isolator I get nothing...probes connected on same wires:
rs232afterisolator.png

after different (dtech) isolator (I have two) same result no signal:
rs323afterdtechisolator.png

I wonder if the isolators need the power wire coming from the inverters...which would power the side of the isolators not getting the signal.
 
Last edited:
I'm going to go back to this. At this point, I got a connection from the container running wombatt to the Atom (confirmed in the Atom log Got Connection...), and the scope showed the command sent on the Tx wire on the RS232 base. I'll try and scope the Rx wire (Tx in the inverter) and see if I get any signal.

As a baseline test, this is what I am getting not connected to the inverter, no isolator, right from the rs232 base. Channel 1 is connected to the R on the rs232 base, and Channel 2 is connected to the T on the rs232 base. The voltages on rs232, from what I've read here:
"By the RS-232 standard a logic high ('1') is represented by a negative voltage – anywhere from -3 to -25V – while a logic low ('0') transmits a positive voltage that can be anywhere from +3 to +25V."
View attachment 219019

after the isolator I get nothing...probes connected on same wires:
View attachment 219020

after different (dtech) isolator (I have two) same result no signal:
View attachment 219021

I wonder if the isolators need the power wire coming from the inverters...which would power the side of the isolators not getting the signal.
The isolator gets power from TX, RTS and/or DTR, I think.
 
The isolator gets power from TX, RTS and/or DTR, I think.
Maybe my connectors aren’t correct. I looked at the ones you linked at the board underneath…maybe some voltage comes off the wires and feeds the rts or other pins making it work right. Be interesting to test that with those connectors and four channels on the scope. I think I’ll order some and try that.
 
So I got the new connectors, same from your link. I have the rs232 base wired to the connector just like yours. gnd to breakout 5, Tx to breakout 2, Rx to breakout 3. According to the RS232 pinout for a male connector, Pin 2 is Rx and Pin 3 is Tx. So Tx on the RS232 base becomes Rx at the male connector, and Rx on the RS232 base becomes Tx. The scope is connected as follows:
CH1 = Male connector Pin 3 (Tx), CH2 = Pin 2 (Rx), CH3 = Pin 7 (RTS), CH4 = Pin 4 (DTR).
So when I run this command to create a docker container (I'm testing with root to avoid any permission issues):
docker run --privileged=true --user root -t gonzalomono/wombatt monitor-inverters 192.168.1.166:8232,Q1 --device-type tcp
...the Terminal Window reads this:
2024/06/08 11:35:22.221315 Opening 192.168.1.166:8232...
...I get this at the Atom Tasmota log (confirming the static IP address of the OrangePi):
12:35:21.326 TCP: Got connection from 192.168.1.17 (We'll disregard the inaccuracy of the timestamps for now)
...when that happens...the scope reads this:
rs232_4channel.png

then after 5 seconds the Terminal Window reads this:
2024/06/08 11:35:27.271689 error running Q1 on 192.168.1.166:8232: timed out sending Q1

and it cycles...but I press ctl-c to quit.

So now, I'll set this up with the isolator...

Terminal: docker run --privileged=true --user root -t gonzalomono/wombatt monitor-inverters 192.168.1.166:8232,Q1 --device-type tcp
2024/06/08 12:07:59.044315 Opening 192.168.1.166:8232...
Atom Tasmota Log:
13:07:58.576 TCP: Got connection from 192.168.1.17
Scope:
rs232_4channel_afterIsolator.png
Terminal:
2024/06/08 12:08:04.148378 error running Q1 on 192.168.1.166:8232: timed out sending Q1
ctl-c

So from this data, it might seem the signal is not getting past the isolator. I don't think it is a problem with where I am running the command, I thought of trying to compile and run outside a container but I think its clear the signal or at least the connection is being sent/established...so the code is working where it is running inside the docker container. We have no permission problems. If it were a problem with the RS232 base, I would think we would not see a scope like we do...I think the scope maybe showing what is supposed to happen...unless I have the scope setup incorrectly. So where to look? Really I'm just doing this as a good example for me to further my understanding of scopes, circuits, etc...but I do have the need to monitor two inverters and was hoping your wombatt will fit the bill. I just can't figure how your's works and mine doesn't.

Oh, and I did try connecting this up to the inverter with the isolator and I got the same logs from the Terminal and Atom, hoping somehow the inverter connection may make it work somehow. My guess is, if I connect the scope somehow with it connected to the inverter I would get the same result...but I cannot confirm that, and I may be wrong. But if this signal did get past the isolator, I would think it would make it to the invertor and we would see something back. But I never did try connected to the inverter and mqqt in the command. I figured I'd try with something simple...I figured the terminal window would report back something from the inverter if the inverter got the signal and responded.

Maybe I'm not getting enough current powering the Atom...do you know how much current your USB Hub is able to deliver per port?
 
Last edited:
So I got the new connectors, same from your link. I have the rs232 base wired to the connector just like yours. gnd to breakout 5, Tx to breakout 2, Rx to breakout 3. According to the RS232 pinout for a male connector, Pin 2 is Rx and Pin 3 is Tx. So Tx on the RS232 base becomes Rx at the male connector, and Rx on the RS232 base becomes Tx. The scope is connected as follows:
CH1 = Male connector Pin 3 (Tx), CH2 = Pin 2 (Rx), CH3 = Pin 7 (RTS), CH4 = Pin 4 (DTR).
So when I run this command to create a docker container (I'm testing with root to avoid any permission issues):
docker run --privileged=true --user root -t gonzalomono/wombatt monitor-inverters 192.168.1.166:8232,Q1 --device-type tcp
...the Terminal Window reads this:
2024/06/08 11:35:22.221315 Opening 192.168.1.166:8232...
...I get this at the Atom Tasmota log (confirming the static IP address of the OrangePi):
12:35:21.326 TCP: Got connection from 192.168.1.17 (We'll disregard the inaccuracy of the timestamps for now)
...when that happens...the scope reads this:
View attachment 220603

then after 5 seconds the Terminal Window reads this:
2024/06/08 11:35:27.271689 error running Q1 on 192.168.1.166:8232: timed out sending Q1

and it cycles...but I press ctl-c to quit.

So now, I'll set this up with the isolator...

Terminal: docker run --privileged=true --user root -t gonzalomono/wombatt monitor-inverters 192.168.1.166:8232,Q1 --device-type tcp
2024/06/08 12:07:59.044315 Opening 192.168.1.166:8232...
Atom Tasmota Log:
13:07:58.576 TCP: Got connection from 192.168.1.17
Scope:
View attachment 220605
Terminal:
2024/06/08 12:08:04.148378 error running Q1 on 192.168.1.166:8232: timed out sending Q1
ctl-c

So from this data, it might seem the signal is not getting past the isolator. I don't think it is a problem with where I am running the command, I thought of trying to compile and run outside a container but I think its clear the signal or at least the connection is being sent/established...so the code is working where it is running inside the docker container. We have no permission problems. If it were a problem with the RS232 base, I would think we would not see a scope like we do...I think the scope maybe showing what is supposed to happen...unless I have the scope setup incorrectly. So where to look? Really I'm just doing this as a good example for me to further my understanding of scopes, circuits, etc...but I do have the need to monitor two inverters and was hoping your wombatt will fit the bill. I just can't figure how your's works and mine doesn't.

Oh, and I did try connecting this up to the inverter with the isolator and I got the same logs from the Terminal and Atom, hoping somehow the inverter connection may make it work somehow. My guess is, if I connect the scope somehow with it connected to the inverter I would get the same result...but I cannot confirm that, and I may be wrong. But if this signal did get past the isolator, I would think it would make it to the invertor and we would see something back. But I never did try connected to the inverter and mqqt in the command. I figured I'd try with something simple...I figured the terminal window would report back something from the inverter if the inverter got the signal and responded.

Maybe I'm not getting enough current powering the Atom...do you know how much current your USB Hub is able to deliver per port?
Did you run "tcpbaudrate 2400" in the tasmota console? You just need to run it once and it will persist across reboots.

The default baud rate for monitor-inverters is already 2400bps, so nothing to do there.
 
Did you run "tcpbaudrate 2400" in the tasmota console? You just need to run it once and it will persist across reboots.

The default baud rate for monitor-inverters is already 2400bps, so nothing to do there.
2024/06/08 14:07:41.189768 Opening 192.168.1.166:8232...
2024/06/08 14:07:41.809058 [00001 22531 01 00 00 022 024 029 024 02 00 000 0030 0000 0000 60.00 11 0 060 030 120 030 55.20 000 120 0 0000]
192.168.1.166:8232 -> Q1
=======================
Time until the end of absorb charging: 1s
Time until the end of float charging: 22531s
SCC flags: Powered and communicating
SCC PWM temperature: 22°C
Inverter temperature: 24°C
Battery temperature: 29°C
Transformer temperature: 24°C
GPIO13: 2
Fan lock status: not locked
Fan PWM speed: 30%
SCC charge power: 0W
Parallel warning: 0
Sync frequency: 60Hz
Inverter charger status: bulk stage

I almost thought to ask about the baudrate, but...it eluded me. Thanks for your help...I figured it was something somewhere small...it had to be there.
 
2024/06/08 14:07:41.189768 Opening 192.168.1.166:8232...
2024/06/08 14:07:41.809058 [00001 22531 01 00 00 022 024 029 024 02 00 000 0030 0000 0000 60.00 11 0 060 030 120 030 55.20 000 120 0 0000]
192.168.1.166:8232 -> Q1
=======================
Time until the end of absorb charging: 1s
Time until the end of float charging: 22531s
SCC flags: Powered and communicating
SCC PWM temperature: 22°C
Inverter temperature: 24°C
Battery temperature: 29°C
Transformer temperature: 24°C
GPIO13: 2
Fan lock status: not locked
Fan PWM speed: 30%
SCC charge power: 0W
Parallel warning: 0
Sync frequency: 60Hz
Inverter charger status: bulk stage

I almost thought to ask about the baudrate, but...it eluded me. Thanks for your help...I figured it was something somewhere small...it had to be there.
The exact same baud rate issue bit me a couple of days ago while testing a custom PCB that will replace the 3 esp32s I'm using for monitoring two inverters and one battery rack with just one esp32s3. 😁

I'm glad you got it working.
 

diy solar

diy solar
Back
Top