Topics

Dire Wolf Telemetry on RPi3

Jon Adams
 

Happy 2020, all, and greetings from Jon N7UV in Phoenix!

I have been running Dire Wolf on an RPi3+, with gpsd, and a Baofeng UV5R with W1GX's nice ptt circuit. The RPi gets accurate time from a little uBlox NEO7 connected to the RPI serial port. Everything runs off 12 vdc unregulated, and I use a buck regulator inside the battery case of the UV5 to get 8 Vdc, and another buck to get the operating voltage for the RPi. Whole thing runs off a 12 Vdc solar panel and a 20 AH gel cell. Typical power draw is 3.7 w receiving, with open squelch. It has been absolutely stable for months now. Kudos to John WB2OSZ for a nice bit of coding!

Now, what I want to do is add the ability for the RPi to collect some telemetry (a few I/O bits, 2 analog voltage values, and 2 DS1820 temperature values, and send them as telemetry packets. I think I've finally gotten the gist of what John's telemetry toolkit suggests, but would really like to be lazier and see if someone else has already done something and can share. I ordered one of the Adafruit ADS1015 4-channel ADCs, and have some DS1820s.

Any people out there who've already forged a path? 

Cheers and 73 - Jon N7UV

bobolink
 

Jon,

Happy 2020 to you as well.
My New Year’s project is to do something along the lines you suggest. But I’m pretty much where you are and won’t be much help I’m afraid. 

I’m heading in the direction of having an external processor (Arduino or ESP32) do the actual sensor acquisition/conditioning/formatting and then transfer measurements over to the RPI for transmission. It’s just that development on the Arduino IDE is easier (for me) and there are so many examples/libraries to choose from (including those from Adafruit) for Arduino.

Anyway, please keep us up to date on your progress.

bob
wm6h



Jim Higgins
 

It must have a low duty cycle and draw a heck of a lot less current when not actually receiving a signal since 3.7 W at 12v is about 3.25 amps, which would drain a 20 A-h battery as deeply as the mfgr recommends in about 6 hours... nowhere near long enough to run overnight.

73 de Jim, KB3PU



Received from Jon Adams at 1/3/2020 23:18 UTC:

Whole thing runs off a 12 Vdc solar panel and a 20 AH gel cell. Typical power draw is 3.7 w receiving, with open squelch. It has been absolutely stable for months now. Kudos to John WB2OSZ for a nice bit of coding!

John Pershing
 

.325 amp

On Jan 4, 2020, at 11:03 AM, Jim Higgins <HigginsJ@...> wrote:


It must have a low duty cycle and draw a heck of a lot less current when not actually receiving a signal since 3.7 W at 12v is about 3.25 amps, which would drain a 20 A-h battery as deeply as the mfgr recommends in about 6 hours... nowhere near long enough to run overnight.

73 de Jim, KB3PU



Received from Jon Adams at 1/3/2020 23:18 UTC:

Whole thing runs off a 12 Vdc solar panel and a 20 AH gel cell. Typical power draw is 3.7 w receiving, with open squelch. It has been absolutely stable for months now. Kudos to John WB2OSZ for a nice bit of coding!


Jon Adams
 

Thanks Bob and all -

From what I've read so far in this group, there seems to be a fair amount of doers here, hopefully I can fit in.

I like the idea of using the Arduino for data collection. It's well suited for that. Would you use a network connection between the Arduino and the Pi? I have a Ethernet shield for the Arduino. I guess the trick would be to "send" preformatted telemetry packets to the RPi on either the AGWPE or the KISS network port?  Maybe there's a way to use a serial or USB connection between the two devices?

The truck's current setup uses a Friendcom 5 W data radio and an Argent Data OT3M, running 24/7. The OT3M is kinda flakey, and appears to lock up regularly with power cycling or with the USB connection (to the truck PC) turning on and off. The older setup in the truck was the Friendcom and a KPC3+, which was much more reliable. I'd modded the KPC3+ to have all 5 ADC ports brought out, so I could get my fill of truck telemetry (Vbat, Tbat, Iload, Tcabin, Vload). The truck also sports a 100 W solar panel and a second, deep cycle battery, and it's been exceedingly stable for years. Batteries last as long as they normally do in the PHX heat. 

I'll admit that the power consumption for this Baofeng/RPi approach is way higher than I get with the Friendcom and an OT3M (or KPC3+).. The OT3M pulls maybe 40 mA at 12 Vdc, and the Friendcom is around 75 mA (?) squelched. That's more like a watt, which is nearly 25% of the RPi/Baofeng setup. But, I can't seem to find Friendcom data radios any more, and 5 W is really on the low side of what is needed for APRS in the hinterlands, but the standby power consumption of a 50 W mobile radio prevents it from being left on all the time. (Makes me pine for the "good old days" of a single-channel xtal radio, sipping 20 mA in standby!)

Back to the RPi and Dire Wolf. My continuing confusion was due in no small part to not RTFM %^). Nonetheless, last week I finally did pay attention to John's write-up on the telemetry toolkit, and now I think I get it more. I am neither Python nor Perl savvy (I'd like to be), but now I think I understand that he uses Perl scripts to call Python routines to grab telemetry from the RPi I/O, format the message in Perl, and send to the Dire Wolf modem. So, I ordered one of the ADS1015 4 channel ADCs, like he uses in the example, and maybe I'll be able to get that up and running quickly when it arrives. 

bobolink
 

Jon,

I didn’t know it was that simple to read the ADC! On the rPi.
With everything I2C and python, I guess it is just:
from Adafruit_ADS1x15 import ADS1x15
Perl is kind of scary but python 🐍 is OK.
Maybe I can eliminate the Arduino. 

 

Bob
wm6h

Jon Adams
 

Bob - Well, it ain't done 'till it's done, but thanks for the positivity %^) I'm now reading the ads1x15.py code, and attempting to understand what it does.  - 73 - Jon

Jon Adams
 

Hi Bob -

I got back to this project yesterday after receiving the package from Adafruit. I wired in the Adafruit ADS1015 breakout board according to WB2OSZ's instructions in section 5.2 of his telemetry tool kit pdf.

I installed the kernel support from his section 5.3:

sudo apt-get install python-smbus
sudo apt-get install i2c-tools
sudo raspi-config
(Select Advanced Options then I2C. Answer yes and yes.)

and did all the other things he required in section 5.3.

So far, so good. So on to section 5.4:

After it finishes rebooting, see if we can communicate with the I2C device.
sudo i2cdetect -y 1
You should see something like this:
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- 48 -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

and indeed!!! I saw this. So, the i2c bus is working and it found the ADC. Holy moly.

Next, I attempted to set up on my direwolf RPi the archived Adafruit ADS1x15 routines. From WB2OSZ's telemetry-toolkit manual, he says to perform the following commands:

cd ~
git clone https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code
cd Adafruit-Raspberry-Pi-Python-Code/Adafruit_ADS1x15
chmod +x *.py

The only thing that showed up in the Pi home directory was the Python-Code subdirectory and a readme file, which stated that this is no longer supported. This I knew. While I'm really not sure what I'm doing, I then looked inside the python files and constructed a set of directories to match what it seemed they were expecting. So, at home/pi, I have

pi@RPi3Bplus-server:~ $ ls
Adafruit-Raspberry-Pi-Python-Code  direwolf       Downloads      MagPi        Pictures          testscript
bcm2835-1.60                       direwolf.conf  dw-start.sh    Music        PiPyADC   sdr.conf   Videos
Desktop                            Documents      hp_adda_board  ntp-4.2.8p6  Public    Templates  YAAC
 
where Adafruit-Raspberry-Pi-Python-Code is the main directory it appears the code expects. Inside Adafruit-Raspberry-Pi-Python-Code, I have

pi@RPi3Bplus-server:~/Adafruit-Raspberry-Pi-Python-Code $ ls
Adafruit_ADS1x15  Adafruit_I2C
 
which I believe should be the two directories there.

The contents of the directory Adafruit_ADS1x15 are:

pi@RPi3Bplus-server:~/Adafruit-Raspberry-Pi-Python-Code/Adafruit_ADS1x15 $ ls
Adafruit_ADS1x15.py  Adafruit_I2C.py  ads1x15_ex_comparator.py  ads1x15_ex_differential.py  ads1x15_ex_singleended.py
 
Each of these files I constructed by using nano to copy across the python code from the files of the same name, archived on the Adafruit git site.

Then, according to the Telemetry Toolkit data, I ran the chmod +x *.py command to make all these files executable. So, now I ran his next two commands:

cd ~/Adafruit-Raspberry-Pi-Python-Code/Adafruit_ADS1x15
./ads1x15_ex_singleended.py

and got the unhappy result

pi@RPi3Bplus-server:~/Adafruit-Raspberry-Pi-Python-Code/Adafruit_ADS1x15 $ ./ads1x15_ex_singleended.py
Traceback (most recent call last):
  File "./ads1x15_ex_singleended.py", line 4, in <module>
    from Adafruit_ADS1x15 import ADS1x15
  File "/home/pi/Adafruit-Raspberry-Pi-Python-Code/Adafruit_ADS1x15/Adafruit_ADS1x15.py", line 5, in <module>
    from Adafruit_I2C import Adafruit_I2C
  File "/home/pi/Adafruit-Raspberry-Pi-Python-Code/Adafruit_ADS1x15/Adafruit_I2C.py", line 1
    ../Adafruit_I2C/Adafruit_I2C.py
    ^
SyntaxError: invalid syntax

so, this is where I'm stuck. I don't see an issue with a command ".../Adafruit_I2C/Adafruit_I2C.py", but the python interpreter does seem to.

Anyway, that's where I am right now.

Cheers and 73 - Jon N7UV

bobolink
 

On Sun, Jan 12, 2020 at 07:36 AM, Jon Adams wrote:
constructed a set of directories to match what it seemed they were expecting
Jon,

Sorry. I don’t have the device and am a beginner myself. Not going to be much help.

Bob