Comparing revisions for RaspberryPiInCarProject

Additions:
- Found box from neighbour's electrical junk
- Boards etc Mounted in box https://goo.gl/photos/557hZXdP5od1e4TA7
- i/o Connected and tested https://goo.gl/photos/EBsePoqLMcXUVTai9
- Ordered RTC and Amp modules
- Decided on circuitry for triggers and overrides https://goo.gl/photos/yKk6YVA8tEDinBCm8
- Obtained additional components, decided on switch types
- Got i/o pins working for hold and ACC active
- Moved GPIO pins as interfered with placing the RTC
Deletions:
Pi Pinouts http://pinout.xyz/
- Found [[https://goo.gl/photos/Vkxzb1F7429FF5YAA|box from neighbour's electrical junk]]
- RPi 1B and Powerboard Board, battery [[https://goo.gl/photos/557hZXdP5od1e4TA7|mounted in the box]]
- Basic i/o [[https://goo.gl/photos/EBsePoqLMcXUVTai9 connected and tested]]
- Ordered a [[https://nicegear.co.nz/raspberry-pi/high-precision-real-time-clock-for-raspberry-pi/|RTC]] and [[https://nicegear.co.nz/electronics-gear/adafruit-i2s-3w-class-d-amplifier-breakout-max98357a/|i2S]] amplifier module
- Decided on [[https://goo.gl/photos/yKk6YVA8tEDinBCm8|circuitry for triggers and overrides]]
- Obtained additional components, found some swiches, diodes etc
- Received RTC and Amp module
- Moved the GPIO pins that were planned as the interfered with placing the RTC
- Put script in /etc/rc.local
- Plugged in the GPS mouse
- spent ages getting gpsd to work
- installed ntp and got time set with GPS
- got gpspipe to dump a logfile continually
- got gpspipe to start logging on boot up with /etc/rc.local
- played with a [[http://www.ebay.com/itm/For-Smart-Home-5V-USB-Relay-2-Channel-Programmable-Computer-Control-/190950124351|USB relay]] (Mobius camera switching?)
- wired the box up with switches for ACC and Trigger inputs etc (ref [[https://goo.gl/photos/NFBVQ3dewDmL2xA17|wiring diagram]])
- Got the i2s sound module working
- Installed sox, flite etc and KMWs IVR script, tester IVR
- Looks [[https://goo.gl/photos/2JmdqgAG8XYC6X2s5|like this now]]
At Paul's, 192.168.1.205
=====File system read/write=====
Need a read only fole system os some sort to allow power off at any stage, and improve lifetime of SD car etc in car environment
http://blog.pi3g.com/2014/04/make-raspbian-system-read-only/
http://kurokesu.com/main/2015/12/30/raspberry-pi-setup-for-power-safe-operation/
Set up UnionFS
https://thepihut.com/blogs/raspberry-pi-tutorials/17209332-adding-a-real-time-clock-to-your-raspberry-pi
i2c device so when plugged in - run this to see if it is there
sudo i2cdetect -y 1
set up ntp to set the RTC (I did that with network and GPS time)
Run ##sudo hwclock -w## to write the system time to the RTC board.
then will need to add the RTC kernel module to the file /etc/modules so it is loaded when the Pi boots.
##sudo nano /etc/modules##
add rtc-ds1307 at the end
**Possible fix needed?**
##Note if you're using the Raspbian Jessie or later release
you'll need to disable a systemd (system management daemons) service that gpsd installs. This service has systemd listen on a local socket and run gpsd when clients connect to it, however it will also interfere with other gpsd instances that are manually run (like in this guide). You will need to disable the gpsd systemd service by running the following commands:
sudo systemctl stop gpsd.socket
sudo systemctl disable gpsd.socket
Should you ever want to enable the default gpsd systemd service you can run these commands to restore it (but remember the rest of the steps in this guide won't work):##
Next you need to edit the file: /etc/ntp.conf and add a few lines to it defining the GPS. This can be either before or after the existing lines beginning with server:
# gps ntp
server 127.127.28.0 minpoll 4
fudge 127.127.28.0 time1 0.183 refid NMEA
server 127.127.28.1 minpoll 4 prefer
fudge 127.127.28.1 refid PPS
then restart ntp
##pi@raspberrypi:~$ sudo service ntp restart##
=====USB Relay=====
Used one of these with a USBA cable
http://www.ebay.com/itm/For-Smart-Home-5V-USB-Relay-2-Channel-Programmable-Computer-Control-/190950124351
No HID drivers in raspberry pi so need to build them
https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=77538
http://matthewcmcmillan.blogspot.co.nz/2013/03/compiling-libhid-for-raspbian-linux-on.html
http://www.signal11.us/oss/hidapi/
##If you've installed your own libraries in /usr/local/lib have you run sudo ldconfig after doing that.##
sudo ./usbrelay 2>/dev/null
OUGOH_1=1
OUGOH_2=1
$ sudo ./usbrelay PSUIS_2=0
$ sudo ./usbrelay PSUIS_2=1 PSUIS_1=0
$ sudo ./usbrelay PSUIS_2=0 PSUIS_1=1 0U70M_1=0 0U70M_2=1
Maybe need this?
https://support.hifiberry.com/hc/en-us/articles/205377202-Adding-software-volume-control
Getting a json of the current street location
http://stackoverflow.com/questions/6582479/finding-nearest-street-given-a-lat-long-location
http://maps.googleapis.com/maps/api/geocode/json?latlng=-36.91537505,174.927379794&sensor=true_or_false
=====Other Useful Scripts & Links=====
Maybe a check for wifi and restarting if needed
https://paste.k3a.me/view/449a6f1c
reverse ssh and other useful stuff
http://k3a.me/how-to-make-raspberrypi-truly-read-only-reliable-and-trouble-free/
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki