Device and Firmware
- Raspberry Pi - 2 and Debian Wheezy 7.10/7.11
I have a config.json
or config.ini
file which I send to the Pi in the form of a compressed file with other files (in .tar
)
At the Pi I would have a triggering mechanism (using inotify-tools
) which when receives the compressed file, untars it and then runs a python script to parse through the information.
config
File
{
"pins":{
"20": 1,
"21":0
},
"files":{
"Pi-1": "file1",
"Pi-2": "file2"
}
}
The keys in the above mentioned config.json
file mention the following:
GPIO Pin 20 must be High
GPIO Pin 21 must be Low
Is this possible to set via the rpi.gpio
feature for Python or are there some ready made implementations that some one has in mind or uses with Pis?
Scenario
I am using a Multicasting scenario where I want to send files to many Pis within an ad-hoc network. This is needed since I cannot ssh into each Pi and send files and set the GPIOs individually since this will consume a lot of time (I am expecting at least 50 Pis). SSH is TCP based and hence broadcasting/ multicasting a bunch of files is not possible in general, hence I shifted my focus on UDP and there is something called as Fountain Codes which is an FEC based technique to distribute data(files) within a network. There are a lot of other reasons why I do not use TCP which are beyond the point of this question.
I have an implementation ready for the above mentioned FEC technique where I take one file and distribute it all the Pis that are a part of the Multicast group. As mentioned before I need to configure some GPIO pins on Pis. This configuration varies from Pi to Pi hence a configuration file is needed to specify which Pi will have which settings and which file for further operation.
Reasons for a tar file
it consists of :
a
config
filenumerous files for different Pis (which file belongs to which Pi is mentioned in
config
file)
Hence I compress the whole Pack into a tar
and then untar it at the Pis.