Showing posts with label php5. Show all posts
Showing posts with label php5. Show all posts

Tuesday, July 1, 2014

HLD

A more detailed HLD of the architecture:



The engine (wnw_engine.py) is written in Python, but the bridge library to connect to the sketch ad been re-written. This process is the only one able to communicate with the ATmega32U4 processor that means it's teh only process that will interact with the sensors and output using the dedicated mailbox technology. Assuming that, I write the bridge library (wnw_bridge.py)  in order to open a socket to connect to the mailbox and maintain it open untill the process is killed instead of opening and closing a socket every time you want to read or write a value into the mailbox.
The database access is centralized into a specific library (wnw_database.py) in order to make easy any database changes we will do in the future (including the database itself).
The web interface must be mantained easy and quik so I choose jQuery Mobile and PHP to interact with the DB that is now the only point of contact between out system and the outside world.

Wednesday, June 18, 2014

PHP and SQLite3 installation

At the end I changed my mind and I'll go with SQLite3 instead of MySQL, copying what they do in Officine Arduino.

I have found this useful tutorial to install everything on the Yun, perfect for me.

PHP and its configuration

I still can't see the bonjour service so I cannot upload sketch via Wifi from my Mac, but I keep configuring the Yun.

I've just added PHP5 following this original forum topic from Arduino Forum or this answer from Stackoverflow, it's the same:
- installing php5 and php5-cgi packages
- configure php.ini (doc_root)
- configure and restart uhttpd

Not sure why but this morning (after the Yun has been up and running all the night long) I needed to manually reset it (YUN RST button) because it wasn't able to access internet to download php5 package. The strange think was that the SSH connection with my MacBook was running and I was able to access the device through my browser (192.168.1.11), but the device itself was not able to ping the router (192.168.1.1) and consequently not able to ping/access internet websites.