User Tools

Site Tools


windclock

This is an old revision of the document!


WindClock-III

sinterklaas 20161206 and time to boot up that rpi:

the day after 20161207

  • boot up the rpi
  • upgrade and update
  • install sensehat

testing 20161208

  1. ssh and vnc (see below, troubleshooting)
  2. went through all the features

* calibration! https://www.raspberrypi.org/documentation/hardware/sense-hat/

	  it is in the folder /sensehat/RTEllipsoidFit
	  startup by typing in console: RTIMULibCal
	  + going through all sensors / python: till Detecting movement
  https://www.raspberrypi.org/learning/getting-started-with-the-sense-hat/worksheet/
- made a correction in calibration temperature 
  problem the cpu temperature is preventing a correct reading
  changed it to ((temp - cpu temp) * 0.75), but should be better calibrated
  I guess doing (temp - cpu temp) would be enough and never accurate anyway
  (adding a waterproof temp. sensor would be better...)

testing 20161209 * - want to do ssh and vnc! (working now) pi + pw: timeinventor000

  
  put an ethernet cable between my mac and my pi and .. ah.. no problem
  scan live hosts on network: nmap -sn 192.168.1.0/24
  started up X11, ssh-keygen -R 192.168.1.14 (or any other pi address ip)
  ssh -X pi@192.168.1.14 
  	sudo apt-get install xrdp
  	sudo raspi-config (enable boot to desktop -- console, text console, requiring login)
  	(if you want GUI then type on rpi 'startx')
  --> also this all works now from the terminal on the mac, no problem
  Filezilla works as well with the sftp protocol! 
  
- also fixed the temperature readout calibration and added the 
  get_temperature_from_pressure (default it is using the humidity sensor)
- try to boot with power from usb cable? does not work of course.. 

testing 20161211

(just need a wifi connection)

* (scan for the pi on the network: nmap -sn 192.168.1.0/24)

(start up with ssh -X pi@192.168.1.14 from the terminal on mac)
(start up realvnc client on mac, if needed sudo raspi-config and enable vnc)
(to turn off matrix led terminal: python3 shutoffmatrix.py # script in sensehat folder)
(sudo shutdown -h now)
  1. continued with Detecting movement (pitch-roll-yaw)

https://www.raspberrypi.org/learning/getting-started-with-the-sense-hat/worksheet/

  additionally
  https://www.raspberrypi.org/learning/astro-pi-guide/sensors/movement.md
  again checked all sensors (see above, can be done in python, full code:)

* https://pythonhosted.org/sense-hat/api/

testing on xmas

done: sudo apt-get install ipython done: sudo apt-get install ipython3 done: bring together 9DOF and the tph files into 1.. done: wrote data in a file 'test-9DOF.txt' with this easy example, it works!

  how I like simple things hihi
	name = "John Smith"
	pin = 1234
	file = open("test.txt", "w") # write
	file.write(name+"\n")
	file.write(str(pin)+"\n")
	file.close()
# keep this for reading out....
	file = open("test.txt", "r") # read
	name = file.readline()
	pin = int(file.readline())
	file.close()
	# print name, pin
	

here are more complex examples– from the https://www.raspberrypi.org/resources/

https://www.raspberrypi.org/learning/sense-hat-data-logger/ # write to files, on bootup, ...
https://www.raspberrypi.org/learning/temperature-log # write to file, visualize pyplot, cron

Testing on 2nd XMAS: SENDING DATA TO PC

 + sounds like the simplest solution: 
 http://raspberrypi.stackexchange.com/questions/12955/how-do-i-send-data-from-the-raspberry-pi-to-the-pc
 
 done: installed webpy in a new folder on the pi, the executable is delivering messages
       running the server from the folder with command: ./server.py
       from pc connecting over browser http://192.168.1.13:8080
 had to change the script of server.py
 but now can read files in the 'static' directory

# (which can be dynamically updated with data, but isn't that a bad solution? at least accessible) # later can read it on the pc with the following python code

import urllib
link = "http://192.168.1.65:8080" # Change this address to your settings
f = urllib.urlopen(link)
myfile = f.read()
date = myfile.split(" ")
Also done this: 
http://thisdavej.com/make-your-raspberry-pi-web-server-available-on-the-internet-with-node-js/
start up the server with terminal command (Public folder is serving files) 'http-server'
http://192.168.1.13:8080/ 
did not bind it to port 80 (sudo http-server -p 80)

then installed localtunnel
so, you have to get http-server running and then launch localtunnel as following e.g.

* sudo lt -p 8080 -s windcl0ck -o

then you can access worldwide https://windcl0ck.localtunnel.me

WOW! found out when starting the http-server from another folder then it is taking this folder as a starting directory!!! great - just start it up where the files are hihi in my case the sensehat directory

terminal: http-server
terminal: sudo lt -p 8080 -s windcl0ck -o 
          #change the number in the name for any windclock-III-pi 
haha make sure the python code is running hihi

YIPPEE!

but also tried to fix the fact that localtunnel was interrupted by some sleep state http://raspberrypi.stackexchange.com/questions/4773/raspberry-pi-sleep-mode-how-to-avoid

- sudo iw dev wlan0 set power_save off

(did not help much)

- edit in /etc/kbd/config: POWERDOWN_TIME=0

(did not help much)

- changed startup of xserver in /etc/lightdm/lightdm.conf

[SeatDefaults] section, xserver-command=X -s 0 -dpms

Finally wrote a client page to send around for people to test the data… Windclock-III-Hranice.html

refresh and <object> for inclusion data .txt

somehow it worked and then not anymore ai ai ai tomorrow more??? yeah I think this tunneling is very unstable, unreliable – so switch to nginx? first trying to get a stable internet connection and work headless but localtunnel does not want to boot up without X environment!!!! and there is a bug with localtunnel dropping out

- ai so better go trying

http://raspberrywebserver.com/cgiscripting/setting-up-nginx-and-uwsgi-for-cgi-scripting.html

- and maybe move to websockets if that is stable?

windclock.1483094911.txt.gz · Last modified: 2016/12/30 11:48 by givanbela