This topic contains 4 replies, has 1 voice, and was last updated by JB 5 years ago.
29. May 2014 at 22:49 #962
I am new to Procoding. I know Processing well because I am used to the Arduino platform.
I would like to program a sketch in processing. I already figured out that import of libraries does not work.
I want to open a TCP connection to a server. I would like to use Telnet or HTTP. The data on the server will
be a text file when HTTP is used or a line ended by a newline character. Maybe I can just have a few lines of example code
doing a Telnet or HTTP connection and read and write a few bytes or lines.
Thanks in advance
JB30. May 2014 at 11:32 #963
TCP is an issue, you’ll need a Library for that and this will be incompatible to Processing.js (and Procoding), unless you add a shim that’s using WebSockets or something…
Otherwise, I think you are looking for loadStrings: https://www.processing.org/reference/loadStrings_.html
Also see this nice tutorial how to save a string with loadStrings: http://www.learningprocessing.com/tutorials/php/
Hope this helps,
that helps a lot. The loadStrings is fine to get data from the Arduino Yun. That will be enough for my current project.
But I am curious: How can I get data back to my Arduino Yun? I could write a sketch to receive data, but what can I use with Procoding to get that to the Yun? I need something heading in the opposite direction similar to loadStrings? saveStrings seems to work just on files.
JB31. May 2014 at 11:35 #970
loadStrings also works with URLs.
Have you seen the second link? If you’re calling a webpage with loadStrings, you can also attach arguments in a GET manner, like: loadStrings(“http://myarduino.local/script?param=hello%20Im%20a%20String”);
I’ve worked with a Yún where we installed node.js and I’m communicating with a WebSocket port. That’s super fast and quite reliable, that would be similar to a TCP connection. However, node.js already consumes most of the internal memory.
Btw: Procoding on Mac OS X has node.js support: if it’s installed on your system you can run JS based script with node…7. June 2014 at 21:18 #979
I think I will give PHP a try. It will be necessary for me to work with server based scripts. So PHP is fine.
Maybe OT here but if you are short with disk-space on the root fs on a Yun try this link:
http://arduino.cc/en/Tutorial/ExpandingYunDiskSpace that will expand and move your root fs on an inserted Micro SD card.
Thanks for your help
The topic ‘proccessing on iPad, iPhone access to server’ is closed to new replies.