Self-hosted Development

This example shows how to set up and use simple and inexpensive computer hardware (Android and Raspberry Pi) for monitoring temperature.

For Android < 5.x GNUroot worked well, but not as well since (for pascal).

RPi Zero Wireless Temperature Sensing Development Kit
Hopefully available soon from friends (in Lawrence, Kansas, USA) who help on the phone...
- Raspberry Pi Zero Wireless and case
- Micro SD card with console Debian (see next paragraph)
- Micro USB power supply
- DLP-TEMP-G 3-Channel Temperature Acquisition Board
- Micro USB powered hub
- USB keyboard
- USB mouse
- Micro HDMI to regular HDMI cable (HDMI display extra)

Instructions for minimal console Debian on RPi Zero Wireless
- Get NOOBS LITE here (just 32 MB) and use PC to install on SD card (at least 2 GB) per this
- Set up Zero hardware (similar to this, but a little different as need USB hub and several micro to standard cables)
- When boots up, login to WiFi then select Raspbian Lite (just 1272 MB) to install on the SD card.  Select language and keyboard. When reboot the user is pi and the password is raspberry.
- sudo apt-get update
- sudo apt-get upgrade -y
- sudo raspi-config (can configure auto log in)
- sudo halt (to shut down before power off)

Parts for an embedded temperature sensing kit
- Raspberry Pi Zero Wireless and case
- Micro SD card
- Micro USB power supply
- DLP-TEMP-G and cable to micro USB


C

Android - Check out C4Droid on the play store, uses tcc (if don't install anything else)

RPi - sudo apt-get install tcc (then use nano)


Python

Android - Use the cloud?

RPi - to be added here ASAP


Pascal

New wiki page for Android and RPi

To install Free Pascal 2.6.4 on the RPi:
- sudo apt-get install fpc

To use Free Pascal (some options are listed here)
1) ppcarm (see first two examples here)
2) fpc
3) fp (starts text mode IDE)

Notes on using the Free Pascal Text Mode IDE:
- Alt-F calls up the file menu
- How enable mouse?

Here is unfinished code for software that sends emails (and texts) with the temperature (and power status) every 3 hours.
EasyfpGUI-fpc-3.0.0.arm-linux-082416.tar.gz
EasyfpGUI-fpc-3.0.0.x86_64-linux-080216.tar.gz
- The arm code has the latest dlptempg.pas so be sure to update the older x86_64 code from that.
- This code will hopefully be uploaded later to this page and this page.  Your comments and feedback are appreciated very much!
- The CtrlTerm.pas code included is a version that provides configuration with command line parameters.

Configuration notes for the above code:
- In a terminal in the folder, compile 2 programs:
    sh dlptempg.sh
    sh lssendmail.sh
- Clean dcu folder:
    sh fpclean.sh
- The sendemails.sh file (in bin) must be edited for your email, and the file must only terminate each line with LF (not CR/LF) or you'll get this error:
sendemails.sh: 43: sendemails.sh: Syntax error: end of file unexpected (expecting "then")

To test:
- cd bin
  sudo ./dlptempg - so creates message.txt file (first temp reading is wrong). After file is created do Ctrl-C - to stop dlptempg
- Check that
    sh sendemails.sh 0 subject message.txt (sends text)
  and
    sh sendemails.sh 1 subject message.txt (sends email)
  both run OK
- Return to home folder
- sudo nano .bashrc (then add this at the end of the file: )
if [ $(tty) == /dev/tty1 ]; then
  cd /home/pi/yourfolder/bin/
  sudo ./dlptempg
  cd ..
  cd ..
fi
- Should now work to auto login and auto start the program. Can press "s" key at any time to send both text and email (to test). Ctrl-C still works to stop the program.

Other ideas: watchdog, do same for the BeagleBone, monitor sump pump operation...

For power detection (first pass showing Micro Center prices), run the RPiZw (and your WiFi router) on a battery backup system (~40 US dollars). Purchase a 5V switching power supply (QVS ARUSB-2.5A is ~11 US dollars) to plug into raw power, a 1.5K ohm 1/4 watt resistor, and a Micro-USB extension cable (QVS CC2217-03MF is ~9 US dollars) to cut in half then install the jack onto the DLP-TEMP-G sensor 2 input (along with the 1.5K resistor between Data and Ground so is a pulldown that matches the DLP-TEMP-G onboard pullup resistor).  Change the dlptempg.pas code for the voltage 5 places from 0.5 to 3.75 (should use a constant).  Run the dlptempg program (without the raw power applied) and verify that the voltage displayed every ten seconds is about 2.5V.  Plug in the raw power and it should change to 5.0V.  The dlptempg program is intended to ignore short power interruptions.

Other things to check out:

1) http://jeelabs29.rssing.com/browser.php?indx=61156768&last=1&item=4 - Using Forth http://jeelabs.org/

2) APDE (Android Processing Development Environment - Java)

Return to home page.

Please share your ideas, comments and suggestions. Thanks!