Re: Dire Wolf Telemetry on RPi3


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

Join RaspberryPi-4-HamRadio@groups.io to automatically receive all group messages.