My Banana Pi Projects. More Information at Maker Projects
Download Lubuntu image from LeMaker Resource Downloads
user is bananapi password is bananapi
install LAMP server:
sudo apt-get install tasksel
sudo tasksel
when asked, select LAMP and continue.
install phpmyadmin:
sudo apt-get install phpmyadmin
This will make it easier to create a database when needed.
create user and database named solarPanel
point web browser to the Banana Pi
open phpmyadmin phpmyadmin
user is root password is what you entered in tasksel
create new user and new database at the same time
install mySQL library for Python:
sudo apt-get install mysql.connector
We want the python script to start automatically when the Pi is booted, so that the power values are displayed without user intervention.
For a new system install, in order to make the python script run automatically when the computer is started,
open a terminal and run
crontab -e
Depending on the configuration, add one of the lines:
- For a Banana Pro with the INA3221+RTC hat and the Adafruit LCD hat:
@reboot /media/data/public_html/bananapi/projects/powerMonitor/script/autoStartPM_INA_LCDplate_RTC.sh >> $HOME/testpylog.txt 2>&1
- For a Banana Pro without the INA3221+RTC hat and a MCP23017 based LCD hat:
@reboot /media/data/public_html/bananapi/projects/powerMonitor/script/autoStartPM_noINA_LCDmcp_noRTC.sh >> $HOME/testpylog.txt 2>&1
- For any computer:
@reboot /media/data/public_html/bananapi/projects/powerMonitor/script/autoStartPM_noINA_noLCD_noRTC.sh >> $HOME/testpylog.txt 2>&1
the script is then automatically started when the system boots.
Now run as superuser
sudo crontab -e
add the line
@reboot /media/data/public_html/bananapi/projects/powerMonitor/script/pipe_web.sh >> $HOME/testpylog.txt 2>&1
To disable the autostart, run
crontab -e
and convert the line to a comment.
To run it at at startup again, uncomment the line.