kobuki / VPTools

A weather station transceiver library
18 stars 8 forks source link

I can't get WxReceiver to work. #11

Closed agrodev closed 1 year ago

agrodev commented 1 year ago

I am trying to connect WxReceiver with weewx-meteoRX driver without success. I don't have a moteino, I use an arduino pro mini and an rfm69 868, I'm in Europe and with ISSRx I get good results, I also have a tested and working BMP280. But with WxReceiver I end up stuck in Starting main packet loop. I don't know if the problem is with my board, if the code makes use of the moteino's memory that I don't have.

Any suggestions for something I can do or look at?

What would be the syntax to test WxReceiver directly through the console?

Here are some logs and console output that think could be of interest.

Thanks in advance.

Feb 19 00:26:37 c4lv0 weewx[2030] INFO user.meteostick: meteostick: using serial port /dev/ttyUSB0
Feb 19 00:26:37 c4lv0 weewx[2030] INFO user.meteostick: meteostick: using station type vue
Feb 19 00:26:37 c4lv0 weewx[2030] INFO user.meteostick: meteostick: using baudrate 115200
Feb 19 00:26:37 c4lv0 weewx[2030] INFO user.meteostick: meteostick: using frequency EU
Feb 19 00:26:37 c4lv0 weewx[2030] INFO user.meteostick: meteostick: using rf sensitivity 90 (-90 dB)
Feb 19 00:26:37 c4lv0 weewx[2030] INFO user.meteostick: meteostick: using intemp_corr 0.000000
Feb 19 00:26:37 c4lv0 weewx[2030] INFO user.meteostick: meteostick: using wind calibration file /usr/share/weewx/user/windcal.dat
Feb 19 00:26:37 c4lv0 weewx[2030] INFO user.meteostick: meteostick: using iss_channel 1
Feb 19 00:26:37 c4lv0 weewx[2030] INFO user.meteostick: meteostick: using anemometer_channel 0
Feb 19 00:26:37 c4lv0 weewx[2030] INFO user.meteostick: meteostick: using leaf_soil_channel 0
Feb 19 00:26:37 c4lv0 weewx[2030] INFO user.meteostick: meteostick: using temp_hum_1_channel 0
Feb 19 00:26:37 c4lv0 weewx[2030] INFO user.meteostick: meteostick: using temp_hum_2_channel 0
Feb 19 00:26:37 c4lv0 weewx[2030] INFO user.meteostick: meteostick: using solar_channel -1
Feb 19 00:26:37 c4lv0 weewx[2030] INFO user.meteostick: meteostick: using uv_channel -1
Feb 19 00:26:37 c4lv0 weewx[2030] INFO user.meteostick: meteostick: using transmitters 01
Feb 19 00:26:37 c4lv0 weewx[2030] DEBUG user.meteostick: meteostick: open serial port /dev/ttyUSB0
Feb 19 00:26:37 c4lv0 weewx[2030] INFO user.meteostick: meteostick: establish communication with the meteostick
Feb 19 00:26:37 c4lv0 weewx[2030] DEBUG user.meteostick: meteostick: cmd: 'r': 
Feb 19 00:26:39 c4lv0 weewx[2030] INFO user.meteostick: meteostick: reset: # WxReceiver v2019122001 ready to accept commands
Feb 19 00:26:39 c4lv0 weewx[2030] DEBUG user.meteostick: meteostick: full response to reset: # WxReceiver v2019122001 ready to accept commands
Feb 19 00:26:40 c4lv0 weewx[2030] INFO user.meteostick: meteostick: configure meteostick to logger mode
Feb 19 00:26:40 c4lv0 weewx[2030] DEBUG user.meteostick: meteostick: cmd: '?': 
Feb 19 00:26:40 c4lv0 weewx[2030] DEBUG user.meteostick: meteostick: cmd: 'x180': # OK t1 f1 o0 m1 x190 r0 stopped
Feb 19 00:26:40 c4lv0 weewx[2030] DEBUG user.meteostick: meteostick: cmd: 't1': 
Feb 19 00:26:40 c4lv0 weewx[2030] DEBUG user.meteostick: meteostick: cmd: 'f1': 
Feb 19 00:26:41 c4lv0 weewx[2030] DEBUG user.meteostick: meteostick: cmd: 'r1': # ERR bad command
Feb 19 00:26:41 c4lv0 weewx[2030] DEBUG user.meteostick: meteostick: cmd: 'o3': 
Feb 19 00:26:41 c4lv0 weewx[2030] DEBUG user.meteostick: meteostick: cmd: 'm1': 
raw:88-00-40-2B-D9-00-6E-76-FF-FF station:0 packets:10/0/100.00 channel:1 rssi:-34 batt:err windv:0 winddraw:64 windd:93 temp:70.1 fei:0 delta:2562544 
raw:78-00-40-6E-41-80-09-5D-FF-FF station:0 packets:11/0/100.00 channel:2 rssi:-33 batt:err windv:0 winddraw:64 windd:93 vsolar:1.5 fei:10 delta:2562536 
raw:E8-00-40-88-01-00-49-2C-FF-FF station:0 packets:12/0/100.00 channel:3 rssi:-33 batt:err windv:0 winddraw:64 windd:93 rain:136 fei:-5 delta:2562544 
raw:58-00-40-FF-71-00-E7-41-FF-FF station:0 packets:13/0/100.00 channel:4 rssi:-36 batt:err windv:0 winddraw:64 windd:93 rainsecs:-1 fei:5 delta:2562536 
raw:88-00-40-2B-D9-00-6E-76-FF-FF station:0 packets:14/0/100.00 channel:0 rssi:-35 batt:err windv:0 winddraw:64 windd:93 temp:70.1 fei:-10 delta:2562536 
raw:38-00-40-8A-41-80-1F-BC-FF-FF station:0 packets:15/0/100.00 channel:1 rssi:-33 batt:err windv:0 winddraw:64 windd:93 fei:0 delta:2562536 
raw:E8-00-40-88-01-00-49-2C-FF-FF station:0 packets:16/0/100.00 channel:2 rssi:-35 batt:err windv:0 winddraw:64 windd:93 rain:136 fei:10 delta:2562536 
kobuki commented 1 year ago

No idea what's wrong with your setup. A good sequence looks like this on my old, Moteino-based receiver:

2023-02-19 10:34:44 weewx[145921] DEBUG user.meteostick: meteostick: open serial port /dev/wxreceiver1
2023-02-19 10:34:44 weewx[145921] INFO user.meteostick: meteostick: establish communication with the meteostick
2023-02-19 10:34:44 weewx[145921] DEBUG user.meteostick: meteostick: cmd: 'r': # OK resetting
2023-02-19 10:34:46 weewx[145921] INFO user.meteostick: meteostick: reset: # WxReceiver v2017091302 ready to accept commands
2023-02-19 10:34:46 weewx[145921] DEBUG user.meteostick: meteostick: full response to reset: # WxReceiver v2017091302 ready to accept commands
2023-02-19 10:34:46 weewx[145921] INFO user.meteostick: meteostick: configure meteostick to logger mode
2023-02-19 10:34:46 weewx[145921] DEBUG user.meteostick: meteostick: cmd: '?': # OK t1 f1 o0 m1 x190 r0 stopped
2023-02-19 10:34:46 weewx[145921] DEBUG user.meteostick: meteostick: cmd: 'x200': # OK sensitivity 200
2023-02-19 10:34:46 weewx[145921] DEBUG user.meteostick: meteostick: cmd: 't3': # OK listening to 1 2
2023-02-19 10:34:47 weewx[145921] DEBUG user.meteostick: meteostick: cmd: 'f1': # OK filter on
2023-02-19 10:34:47 weewx[145921] DEBUG user.meteostick: meteostick: cmd: 'r1': # OK repeater pass-through enabled
2023-02-19 10:34:47 weewx[145921] DEBUG user.meteostick: meteostick: cmd: 'o3': # OK output raw 10B
2023-02-19 10:34:47 weewx[145921] DEBUG user.meteostick: meteostick: cmd: 'm1': # OK band EU

Then it spews things like this (debug mode on max):

2023-02-19 10:34:54 weewx[145921] DEBUG user.meteostick: meteostick: station said: 49 20 31 30 30 20 41 31 20 30 30 20 41 43 20 30 30 20 30 31 20 30 30 20 33 32 20 46 44 20 46 46 20 46 46 20 20 2D 35 35 20 30 20 2D 31
2023-02-19 10:34:54 weewx[145921] DEBUG user.meteostick: meteostick: readings: I 100 A1 00 AC 00 01 00 32 FD FF FF  -55 0 -1
2023-02-19 10:34:54 weewx[145921] DEBUG user.meteostick: meteostick: wind_speed_raw=000 wind_dir_raw=0x0ac
2023-02-19 10:34:54 weewx[145921] DEBUG user.meteostick: meteostick: WS=0.0 WD=239.47826086956522 WS_raw=0 WS_ec=0 WD_raw=172 WD_pro=239.47826086956522 WD_vue=242.175
2023-02-19 10:34:54 weewx[145921] DEBUG user.meteostick: meteostick: data: {'channel': 2, 'rf_signal': -55, 'rf_missed': 0, 'bat_anemometer': 0, 'wind_speed_ec': 0, 'wind_speed_raw': 0, 'wind_dir': 239.47826086956522, 'wind_speed': 0.0}
2023-02-19 10:34:54 weewx[145921] DEBUG user.meteostick: meteostick: packet: {'windSpeed': 0.0, 'windDir': 239.47826086956522, 'windBatteryStatus': 0, 'dateTime': 1676799294, 'usUnits': 17}
...

I see this in your log (among others):

 Feb 19 00:26:41 c4lv0 weewx[2030] DEBUG user.meteostick: meteostick: cmd: 'r1': # ERR bad command

The init sequence doesn't look right. Did you modify the driver code? What version do you use from weewx and the driver? How did you install the driver? Pro Mini is fine, it's using the same chip as the original Moteino. The flash memory is not needed.

agrodev commented 1 year ago

Thanks kobuki, I did a fresh install of weewx from apt, the version is 4.10.1. I installed the driver following your instructions from the link: https://github.com/kobuki/weewx-meteoRX/archive/master.zip, I find version is 2021101701.

At first I had some error that I solved by installing the Python future dependencies. I have not modified anything in the driver, only download it and install. Only modified weewx.conf, but I do not see that the repeater is an option in these file.

Also I have tried to manually talk to wxreceiver by Arduino console, but only get errors. I tried to find out the syntax in the meteostick documentation, but couldn't get it right.

kobuki commented 1 year ago

Can you provide a binary log of the communication between your serial terminal and the receiver? I'm suspecting a wonky serial connection. The command interface is very simple and has proven to be pretty robust so I can't think of anything else at the moment. ISSRx doesn't use any command interface and it works for you so there must be something going on with the connection. Maybe one more thing: if you use an RPi with the receiver and it's connected to a monitor, try without the monitor and use an SSH connection to control things.

agrodev commented 1 year ago

I am using a virtual machine with ubuntu server 22.04, I checked with screen and ISSRx the communication of the board in linux server. I don't understood very well what are requesting, can you suggest me a tool to generate that log on linux?

kobuki commented 1 year ago

I suspect the commands are not sent out properly to the device. Maybe you could try another USB-serial adapter and double-check the voltage. I assume you're using a 3.3V Arduino board, since the RFM69 radio doesn't handle voltages above around 3.6V. You could also try with a lower baud rate (needs reflashing the ATMega).

agrodev commented 1 year ago

Yes, when you suggested the problems in the serial connection I tried with other serial adapters. Thanks again for your help.

kobuki commented 1 year ago

So it works now, using a different adapter?