The purpose of this Instructable is to illustrate how to set up and use IPC (interprocess communication) between a Python script and the executing sketch on the Intel Galileo board. In addition to providing the source code I will be going over the code in detail and pointing out the rationale behind several decisions. The hope is that this will make it easier for you if something breaks or you want to extend the code's functionality. It wouldn't really be very instructional if I mailed you a finished product therefore this Instructable isn't complete without a solid walk-through of the code.
I recommend downloading the files in the /sketch, /python, and /examples from my GitHub (https://github.com/bunneydude/IPCBuffer). The readme files contain instructions on how to install them. Also, download the nrf24.zip file below (the slightly modified radio library for porting to Galileo from here). Instead of posting the code in the Instructable you can follow along with the source code itself.
That being said, documentation is not complete without examples. After the code walk-through there are instructions on how to use this IPC library to decrypt data the Galileo receives wirelessly from a MSP430.
The following skills will be somewhat assumed for this Instructable:
With the MSP430 board and Galileo powered up, launch the shm_python script as specified above. When you ground one of the six port 2 pins on the MSP430 a message should be printed saying which pin was pressed. The current encoding in shm_python.py is specific to how the wires were laid out on my breadboard. The MSP430 code supports grounding multiple pins - additional values just need to be added to the key dictionary in shm_decrypt.py.
To destroy the IPC objects, download python_interface.zip and run tui.py (requires pySerial) from the computer you used to program the Galileo. Launching tui.py will open a COM port (defaults to COM 5) at 115200 baud. This is a simple script to send and receive serial data consistent with the protocol coded into galileo_ipc.ino. Reading from register 1 will call myBuffer.close() within the sketch. I.e.
Ingresa el e-mail asociado con tu cuenta y te enviaremos tu usuario y una contraseña temporal.