|
1 | 1 | # fpms |
2 | | -Front Panel Menu System (Consolidation of NanoHatOLED & BakeBit) |
| 2 | +**WLAN Pi Front Panel Menu System** |
| 3 | + |
| 4 | +This project is the consolidation of the forked NanoHatOLED & BakeBit repos that were used to build the original front panel menu system for the WLAN Pi. |
| 5 | + |
| 6 | +The original repos contained many files that were not needed for the WLAN Pi, and were also based on python 2. This provided a number of support issues. Therefore, both repos were combined in to a unified repo, conversions were completed to support python 3 and extraneous files from the original repos were removed to provide a slimmed down code base. |
| 7 | + |
| 8 | +The repo may be installed on to a WLAN Pi by simply cloning this repo as the wlanpi user: |
| 9 | + |
| 10 | +``` |
| 11 | +cd ~ |
| 12 | +git clone --single-branch --branch master https://github.com/WLAN-Pi/fpms.git |
| 13 | +``` |
| 14 | + |
| 15 | +The following steps must also be completed: |
| 16 | + |
| 17 | + 1. Edit the oled-start file : "sudo nano /usr/local/bin/oled-start" |
| 18 | + |
| 19 | + from: |
| 20 | + |
| 21 | + #!/bin/sh |
| 22 | + cd /home/wlanpi/NanoHatOLED |
| 23 | + ./NanoHatOLED |
| 24 | + |
| 25 | + to: |
| 26 | + |
| 27 | + #!/bin/sh |
| 28 | + cd /home/wlanpi/fpms |
| 29 | + ./NanoHatOLED |
| 30 | + |
| 31 | + 2. Run "sudo crontab -e" and change : |
| 32 | + |
| 33 | + @reboot /home/wlanpi/NanoHatOLED/BakeBit/Software/Python/scripts/networkinfo/networkinfocron.sh |
| 34 | + |
| 35 | + to: |
| 36 | + |
| 37 | + @reboot /home/wlanpi/fpms/BakeBit/Software/Python/scripts/networkinfo/networkinfocron.sh |
| 38 | + |
| 39 | + 3. Clone the "fpms" repo as wlanpi user: |
| 40 | + |
| 41 | + cd ~ |
| 42 | + git clone https://github.com/WLAN-Pi/fpms.git |
| 43 | + |
| 44 | + 4. Remove the old NanoHatOLED folder: |
| 45 | + |
| 46 | + cd ~ |
| 47 | + sudo rm -rf ./NanoHatOLED |
| 48 | + |
| 49 | + 5. Sync filesystem: |
| 50 | + |
| 51 | + sudo sync |
| 52 | + |
| 53 | + 6. Power off/on (not reboot from CLI ) the WLAN Pi |
| 54 | + |
| 55 | +Once the fpms package has been successfully installed and is operational, it may be updated using the WLAN Pi package admin tool 'pkg_admin": |
| 56 | + |
| 57 | +``` |
| 58 | + pkg_admin -i fpms -b <branch/version name> |
| 59 | +``` |
| 60 | + |
| 61 | +## Original Migration Notes |
| 62 | + |
| 63 | +The move to python 3.5 required several file updates to provide support for the new python version. When moving to python 3.7 in the future, these will need to be completed again (with appropriate updates for 3.7) to support the new version. The steps are documented here for future reference (these were kindly figured out & provided by Adrian Granados): |
| 64 | + |
| 65 | + 1. Install the following packages: |
| 66 | + |
| 67 | + sudo apt-get install python3-smbus |
| 68 | + sudo python3 -m pip install pillow |
| 69 | + |
| 70 | + 2. In line 90 of ~/NanoHatOLED/Source/main.c, replace the string “python2.7” with “python3.5” so that it reads as follows: |
| 71 | + |
| 72 | + rv = find_pid_by_name( "python3.5", py_pids); |
| 73 | + |
| 74 | + 3. In line 119 of ~/NanoHatOLED/Source/main.c, replace the string “python” with “python3” so that it reads as follows: |
| 75 | + |
| 76 | + sprintf(cmd, "cd %s/BakeBit/Software/Python && python3 %s 2>&1 | tee /tmp/nanoled-python.log", workpath, python_file); |
| 77 | + |
| 78 | + 3. Recompile NanoHatOLED: |
| 79 | + |
| 80 | + cd ~/NanoHatOLED |
| 81 | + gcc Source/daemonize.c Source/main.c -lrt -lpthread -o NanoHatOLED |
| 82 | + |
| 83 | + 4. Update syntax errors thorwn up by the new version of python in the following files: |
| 84 | + NanoHatOLED/BakeBit/Software/Python/bakebit_128_64_oled.py |
| 85 | + NanoHatOLED/BakeBit/Software/Python/bakebit_nanohat_oled.py |
| 86 | + |
| 87 | + |
0 commit comments