crescentvenus / WALB

WALB is raspberry Pi and HackRF based Wireless Attack LaunchBox.
121 stars 29 forks source link

Hardware help rotary encoder and Display scripts #19

Open th2112 opened 4 years ago

th2112 commented 4 years ago

I am attempting to get the “hardware” working on this project. IE the rotary encoder and the display working. I think everything is working good via the UI website. So the problem I have is this… ( NOT sure if this is the right way to launch the needed .py files to start this or not.) I think I have all the files in the correct directories. ANY help would definitely help me keep what is left of my hair from being pulled out! Thanks, In advance!

When I launch the file replay2 I get the following.. pi@raspberrypi:~ $ ./replay2 Main menu:menu2.txt Tx-POWER 0 0 0 2016/04/15,00:00:00 Error: Write failed Error: Write failed ^C pi@raspberrypi:~ $

When I launch the file replay2 as sudo I get the following.. pi@raspberrypi:~ $ sudo ./replay2 Main menu:menu2.txt Tx-POWER 0 0 0 2016/04/15,00:00:00 sh: 1: i2c-disp.sh: not found sh: 1: i2c-disp.sh: not found ^C

When I launch the file replay2.py I get the following…

pi@raspberrypi:~ $ ./replay.py Config file: /home/pi/replay.ini

replay4 python Traceback (most recent call last): File "./replay.py", line 642, in main() File "./replay.py", line 595, in main View.display('replay4', 'python') File "./replay.py", line 119, in display Command.call(['/bin/i2c-disp.sh', '-i', message1]) File "/usr/lib/python2.7/subprocess.py", line 172, in call return Popen(*popenargs, **kwargs).wait() File "/usr/lib/python2.7/subprocess.py", line 394, in init errread, errwrite) File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory pi@raspberrypi:~ $

Here is some of my version info running on the RPI 3

Version info

GPIO info pi@raspberrypi:~ $ gpio -v gpio version: 2.46 Copyright (c) 2012-2018 Gordon Henderson This is free software with ABSOLUTELY NO WARRANTY. For details type: gpio -warranty

Raspberry Pi Details: Type: Pi 3, Revision: 02, Memory: 1024MB, Maker: Embest

pi@raspberrypi:~ $ cat /etc/os-release PRETTY_NAME="Raspbian GNU/Linux 10 (buster)" NAME="Raspbian GNU/Linux" VERSION_ID="10" VERSION="10 (buster)"

th2112 commented 4 years ago

From what I can tell from the file replay2.ini all the scripts ( sim_start.sh, wlan.sh, eth.sh ect...) should be placed in /home/pi/ directory. The only exception is the file is the i2c-disp.sh and that should be in the /home/pi/bin folder. ( I have a exact copy of i2c-disp.sh in both the /home/pi/ dir. and the /home/pi/bin directory.

th2112 commented 4 years ago

here is a listing of the files located in the home/pi directory total 464 drwxr-xr-x 28 pi pi 4096 Sep 8 14:23 . drwxr-xr-x 3 root root 4096 Feb 13 2020 .. -rwxr-xr-x 1 pi pi 277 Aug 25 14:29 ads-b.sh lrwxrwxrwx 1 pi pi 30 Aug 25 21:48 autoupgrade.sh -> /home/pi/scripts/autoupdate.sh -rw------- 1 pi pi 10793 Sep 7 01:35 .bash_history -rw-r--r-- 1 pi pi 220 Feb 13 2020 .bash_logout -rw-r--r-- 1 pi pi 3523 Feb 13 2020 .bashrc drwxr-xr-x 2 pi pi 4096 Sep 4 15:12 bin drwxr-xr-x 5 pi pi 4096 Feb 13 2020 .cache drwx------ 7 pi pi 4096 Sep 3 11:14 .config -rw-r--r-- 1 root root 213768 Sep 8 13:48 current_brdc -rw-r--r-- 1 pi pi 23 Aug 25 14:29 date2.txt drwxr-xr-x 2 pi pi 4096 Feb 13 2020 Desktop drwxr-xr-x 2 pi pi 4096 Feb 13 2020 Documents drwxr-xr-x 2 pi pi 4096 Feb 13 2020 Downloads -rwxr--r-- 1 pi pi 348 Aug 25 14:29 eth.sh drwx------ 3 pi pi 4096 Feb 13 2020 .gnupg drwxr-xr-x 7 pi pi 4096 Sep 8 13:48 gps-sdr-sim drwxr-xr-x 9 pi pi 4096 Sep 6 23:08 hackrf drwxr-xr-x 2 root root 4096 Sep 8 13:48 HOURLY_BRDC -rwxr--r-- 1 pi pi 613 Aug 25 14:29 i2c-disp.sh drwxr-xr-x 2 pi pi 4096 Aug 25 14:29 images drwxr-xr-x 2 root root 4096 Sep 6 23:06 IQ-files -rwxr--r-- 1 pi pi 344 Aug 25 14:29 kill_proc.sh -rw-r--r-- 1 pi pi 19 Aug 25 14:29 level2.txt drwxr-xr-x 3 pi pi 4096 Feb 13 2020 .local drwxr-xr-x 2 pi pi 4096 Feb 13 2020 MagPi -rw-r--r-- 1 pi pi 527 Aug 25 14:29 menu2.txt drwxr-xr-x 2 pi pi 4096 Feb 13 2020 Music drwxr-xr-x 2 pi pi 4096 Feb 13 2020 Pictures -rw-r--r-- 1 pi pi 807 Feb 13 2020 .profile drwxr-xr-x 2 pi pi 4096 Feb 13 2020 Public drwxr-xr-x 2 pi pi 4096 Aug 26 01:00 python -rw-r--r-- 1 pi pi 4927 Aug 25 14:29 README.md -rwxr-xr-x 1 root root 18760 Aug 26 00:32 replay2 -rw-r--r-- 1 pi pi 9971 Aug 25 14:29 replay2.c -rwxr--r-- 1 pi pi 3291 Aug 25 14:29 replay.ini -rwxr--r-- 1 pi pi 19656 Sep 4 14:29 replay.py drwxr-xr-x 3 pi pi 4096 Aug 25 12:36 rpi-clone drwxr-xr-x 2 pi pi 4096 Sep 4 14:10 scripts -rwxr--r-- 1 pi pi 1207 Aug 25 14:29 sim_start.sh -rwxr--r-- 1 pi pi 136 Aug 25 14:29 stat.sh drwxr-xr-x 2 pi pi 4096 Feb 13 2020 Templates lrwxrwxrwx 1 pi pi 26 Aug 25 21:54 update.sh -> /home/pi/scripts/update.sh drwxr-xr-x 2 pi pi 4096 Feb 13 2020 Videos drwx------ 3 pi pi 4096 Aug 25 13:17 .vnc drwxr-xr-x 8 pi pi 4096 Aug 25 14:29 WALB drwxr-xr-x 11 pi pi 4096 Aug 26 00:21 wiringPi drwxr-xr-x 2 root root 4096 Aug 26 00:48 WIRINGPI -rwxr--r-- 1 pi pi 349 Aug 25 14:29 wlan.sh

th2112 commented 4 years ago

here is the directory of /home/pi/bin directory pi@raspberrypi:~/bin $ ls -la total 144 drwxr-xr-x 2 pi pi 4096 Sep 4 15:12 . drwxr-xr-x 28 pi pi 4096 Sep 8 14:23 .. -rwxr-xr-x 1 pi pi 277 Aug 25 14:29 ads-b.sh lrwxrwxrwx 1 root root 26 Sep 4 13:57 autoupdate.sh -> /home/pi/scripts/update.sh lrwxrwxrwx 1 root root 33 Sep 4 15:07 current_brdc -> /home/pi/HOURLY_BRDC/current_brdc -rwxr--r-- 1 pi pi 348 Aug 25 14:29 eth.sh -rwxr-xr-x 1 pi pi 42772 Aug 25 14:29 gps-sdr-sim -rwxr-xr-x 1 pi pi 60744 Aug 25 14:29 gps-sdr-sim_x64 -rwxr--r-- 1 pi pi 613 Aug 25 14:29 i2c-disp.sh -rwxr--r-- 1 pi pi 344 Aug 25 14:29 kill_proc.sh -rw-r--r-- 1 pi pi 3280 Aug 25 14:29 README.txt -rwxr--r-- 1 pi pi 1207 Aug 25 14:29 sim_start.sh -rwxr--r-- 1 pi pi 136 Aug 25 14:29 stat.sh lrwxrwxrwx 1 root root 26 Sep 4 13:57 update.sh -> /home/pi/scripts/update.sh -rwxr--r-- 1 pi pi 349 Aug 25 14:29 wlan.sh pi@raspberrypi:~/bin $

crescentvenus commented 4 years ago

Try put i2c-disp.sh in /bin not "/home/pi/bin". By the way my WALB is in pieces.

th2112 commented 4 years ago

I tried that. Same thing. I tested the display using a python script and it works. I used https://www.circuitbasics.com/raspberry-pi-i2c-lcd-set-up-and-programming/. It used a script called i2cdetect -y 1 and it identified the address of the i2c hardware. I don't understand enough about the i2cset tools you used to see it it is set to the value of 27. see below ... Do you think this might be set to the wrong address?

pi@raspberrypi:/dev $ i2cdetect -r 1 WARNING! This program can confuse your I2C bus, cause data loss and worse! I will probe file /dev/i2c-1 using receive byte commands. I will probe address range 0x03-0x77. Continue? [Y/n] Y 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- 27 -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- --
pi@raspberrypi:/dev $

crescentvenus commented 4 years ago

I think, there are many cases where PATH and/or permission is not correct corresponding to the user who executed it.