LionelDarras / PyCampbellCR1000

Communication tools for Campbell CR1000-type Datalogger http://pycampbellcr1000.readthedocs.org
GNU General Public License v3.0
43 stars 32 forks source link

Dataloggers local network. Talk to a CR1000 (pakbus 2) through a CR1000 (pakbus 1) #19

Open rr4v opened 3 years ago

rr4v commented 3 years ago

Congratulations LionelDarras, your code is great. It's an amazing improvement for anyone interested in working with Campbell dataloggers, specially from raspberry pi and other linux based devices. Thank you very much for that! The only thing I miss to fulfill all my needs is that I can not access to other dataloggers in local networks. Particularly: I have a 1st CR1000 with pakbus 1 configured as router (isRouter selected as true in Device Configuration Utility) and a 2nd CR1000 with pakbus 2 physically connected through serial com to the 1st CR1000. This is the setup configuration: setup Note that, for successful connection, second datalogger must be hanging from the first one in the Setup Utility as shown in the picture. Using pycr1000 I can access to the 1st datalogger with pycr1000 gettime tcp:ip:port --dest 1 but when I try to access to the 2nd datalogger fails with any "--dest 2" or "--dest_addr 2" options :

log.txt

Note: If I physically connect the computer to any of the dataloggers directly, I can successfully access them with: "pycr1000 gettime serial:COMx:115200 --dest 1" for 1st CR1000 or "pycr1000 gettime serial:COMx:115200 --dest 2" for 2nd CR1000 So, it seems that it is not a pakbus port problem but something related to routing. I sniffed comunications betwen Loggernet and both dataloggers. I could show you that logs if they were useful.

I will appreciate very much any suggestion or clue to solve this limitation.

rr4v commented 3 years ago

I sniffed serial port communications between Logernet and CR1000 and I found that when I connect to the datalogger with PB2 hanging from PB1, Loggernet first connect to PB1 and then send gettime command (or any other) to PB2. I tried to repeat this behaviour with PyCampbellCR1000 and it use to fail in the self.ping_node() function. Sometimes, if I skip this step, it seems to work. But not allways and not for all the commands.