Go Down

Topic: Project Steps (Read 1 time) previous topic - next topic


I got the Yun for what I thought would be a pretty simple project.  Of course when your ignorant everything seems simple... I've managed to run through some examples and feel moderately comfortable with what's what but need some help connecting the dots from wiser minds.

General Intent - send strings and/or hex UDP (I'll start with UDP anyways) based on a DI closure.  Receive string via UDP address that controls DO (LED button backlight).

Step 1 - I need to be able to read the text strings from a web page and store them to the SD card in a file with a key for the button (DI) number they correspond to.  Don't care if it's stored xml or CSV or whatever. 

Step 2 - When DI closes send corresponding  strings from SD card to UDP address. 

Step 3 - Read incoming UDP message and light appropriate button

My instinct is that I should do the heavy lifting on the linino side with Python?  So basically when a Di is closed it simply uses the Bridge to call a UDP send script passing it the DI# as the key for referencing the string on the SD card? When a string is received Python server parses and then uses Bridge to control DOs?  Is this the best approach?

Any and all direction appreciated.


I agree it's the best approach, especially because you can't send UDP packets directly from the sketch (like you do with the ethernet shield)
As your project relies on a file, it makes sense to put as much code to python as possible


Thanks.  I was a bit confused because I went through a bunch of examples using UDP but then realized they wereassuming use of an ethernet shield.  It seems the Yun is a different approach altogether.

So it looks like the Bridge library is meant to allow control over a lot of linino side functions from the micro side and vice versa.  If I understand correctly then I will use the Process command to call the Python script  and  addParameter() to pass the DI # as my reference key?  If this is correct, then how do I reference the string to send from the SD card?  It looks like I can reference the card from the sketch use the Bridge so I guess I could pass it as a parameter as well but this seems the long way around.  Can I read the file directly from Python?  I'm guessing yes but can't find any examples how to.

Thanks again for the help.


It doesn't make much sense to go back and forward from your sketch to python: if you have enough information to properly open the right file from python, do that. Google around "python file" for examples

Go Up