Close

Intergration, software and automation.

A project log for CamperCycle

A rather large project that spans multiple disciplines. Despite of a chronic illness that leaves me fatigued a lot of the time.

timescaleTimescale 03/17/2024 at 22:400 Comments

While you might argue that this is all unnecessary weight and a drain on the battery, it me reply that this is the core essence of the idea that every part should at least have 2 functions. In this case some have many many more.

Lets look at the current integration of the hardware stack. I try to let each element do what it does best

The core is the raspberry pi. It runs a LAMP stack for the interfaces on the IOS devices. It also runs a Python web service which communicates with the Arduino. It sends commands and data requests and gets back the status and requested data in XML format in return. The reason why this is a separate web server is so other platforms and devices are not depended directly for the interface software to manage data streams. If a device needs GPS data, it can ask for it without waiting for an update on the core system or relying on a Rube-Goldberg machine'esque communication chain where some some PHP script must output suitable data for the end device by calling the Python script next door every single time. Now it does not matter if I need the data in the shell, in PHP, in Python itself or in javascript running on the consoles.A third socket service will eventually run on the RPi for the rear camera so it can run on any screen when needed.

The RPi also runs the music via CMUS and can do voice alerts with espeak. These are combined in software to not interfere to much. I also want to add FM and DAB+ radio and I know it can be done, but more study is needed for that.

The arduino could not be simpler. It just has IO and follows commands via serial and sends data on request back via serial. Want to let the indicator blink left? Press the left indicator icon on the control screen which will send a httprequest with the proper command with JS to the python server which will send it to the Arduino which, if all goes well, starts the blink function and makes the relay switch go on and off. It sends back XML data about the recieved command, the result and so on.

Then there is the 2 by 16 matrix display. I wanted the dash to be as clear as possible. a main screen, a start key switch and some USB ports, but who does not like a matrix display? I mainly use it for debugging right now to see is the arduino is doing what it should directly, but It could be fun for it to display random semi relevant data. I think I'll keep it.

Of course there are a gazillion ways to do this, but this is what I cobbled together and it sees quite stable.

Discussions