loading

Step 4: Upload Sketch to the Arduino

Now for the moment we've all been waiting for. Time to make some magic happen and upload the Teleduino sketch to your Arduino.

Please note that the unique API key from Step 1 is required to proceed.

Open up the Arduino IDE. Click 'File' -> 'Examples' -> 'Teleduino328' -> 'TeleduinoEthernetClientProxy'. This will open up the sketch that we'll be using.

Near the top of the file you'll see some network configuration variables. If you're feeling adventurous you can play with these, but the default should work fine. The only thing we recommend changing is the MAC address declaration, even if it's just a matter of changing the last byte to something like 0x01. MAC addresses must be unique on your network (which is why we recommend you change it from the default). If you are setting up two or more Teleduino devices, you must ensure their MAC addresses are different.

The one thing that must be set is the unique key. See the attached image as a reference. By default they are set to a bunch of zeros. To make it easier, when you receive your unique API key, you'll also receive a URL to a tool which outputs your key in a format that can be copied and pasted into the sketch.

Once your key is set, connect your Arduino (if you haven't already), ensure the correct serial port is selected, and click 'Upload'. All going well the sketch will compile and upload.

Viola!
I just wanted to say that you can download an early version of Teleduino Controller for Android devices on Google Play :<br> <a href="https://play.google.com/store/apps/details?id=appinventor.ai_ssslzc.Teleduino_Controller" rel="nofollow">https://play.google.com/store/apps/details?id=appinventor.ai_ssslzc.Teleduino_Controller</a><br> <br> And like the info says, if you miss any functions please contact me and I will try to add it in future releases.
<p>hi, how do i get incontact with you?</p>
<p>Hi Nathan, thanks for this project and excellent tutorials, just what I was looking for...</p><p>I am using the Teleduino service with a cheap clone UNO, Ethernet Shield and relay board. Much to my surprise after some set up I had no problems getting the response:</p><p>{&quot;status&quot;:200,&quot;message&quot;:&quot;OK&quot;,&quot;response&quot;:{&quot;result&quot;:1,&quot;time&quot;:0.17647790908813,&quot;values&quot;:[]}}</p><p>However, after a few minutes, during which I am opening and closing relays quite happily, the Shield seems to lose its connection and I go back to this:</p><p>{&quot;status&quot;:403,&quot;message&quot;:&quot;Key is offline or invalid.&quot;,&quot;response&quot;:[]}</p><p>Getting the connection back involves resetting either the shield or the UNO, either will work. Then it operates for another few minutes. Once it loses connection, I never get it back without a reset, then it invariably comes back within a few seconds.</p><p>I have read around all kinds of posts with solutions like adding capacitors, cutting tracks, setting heartbeats etc. In most cases this was because the power had gone down to the device which is not my situation.</p><p>Can you please point me in the right direction?</p><p>Much appreciated!</p><p>John</p>
<p>Hi, when I start the teleduino controller Pro app in my Samsung Vibrant I get always the error message 1101: US.01.proxy.teleduino.org cannot download. The same app is functioning OK with my tablet Lenovo. I don't get it how is it possible..</p>
can any one help me please ?? <br> <br>i wont to use arduino in my project .. <br>i wont ardino send alarm to my androin phone 'by internet ' whin the Bell home is ring <br>What are the pieces that will I need ?? <br>remember by internet no IRir no blotooth <br>thank you
<p>Hi wasimxxl. There are many 'Arduino' ways to do this. The current implementation of Teleduino doesn't support 'push', however an upcoming version certainly will. Stay tuned!</p>
<p>The ethernet shield is based on the W5100 ic. By any chance, was anyone able to make teleduino work using the much cheaper ENC28J60 ethernet controller chip?</p>
<p>Hi Dr_L. I haven't seen any successful examples using the ENC28J60 yet, however there is a new firmware in the works which will be versatile enough to hopefully provide a mechanism for this. Stay tuned!</p>
<p>Can new values for variables (as set temps in a thermostat) be sent to the Arduino?</p>
<p>Hi bclagett. With the current version this is not that easy to achieve. There is a completely new revision of the firmware in the works which will provide the ability for people to customise their requirements. Stay tuned!</p>
<p>Hello! I have this problem: Everything works well until the power is in charge of Arduino. But if you turn the power off and back on, the connection to the server Teledyne not happening! The led is burning. If you press the reset button on the Board, then everything begins to work as it should! What you need to do to when power is turned off,then I could then press the button on the Board. Thank you!</p>
<p>Hi Tchernyavsky. This sounds like a common problem with the early ethernet shields. See http://forum.arduino.cc/index.php?topic=25634.0</p>
<p>Excuse me why my UNO LED just blink 6 times....</p><p>and manage presets say <strong>Key is offline or invalid.</strong></p><p>I had changed 3 keys... </p>
<p>Hi buzz.pai. 6 flashes means that the API key configured into the sketch is invalid. This could potentially be caused by a copy/paste error when loading the key in? Please try again and advise if the problem persists.</p>
<p>Hello,</p><p>Need help. The link LED on the W5200 ethernet shield is always red. The Led on pin 8 blinks: 1, 1-2. That is all that is happening. Please assist in resolving. Thank you.</p>
<p>Hi SS_2013. Did you ever get this working? I'm not sure if the W5200 is compatible with the W5100. Has anyone else successfully used the W5200?</p>
<p>I was able to get the first URL to work, but the second and all related to LED control on next steps give me the following error message.</p><p>{&quot;status&quot;:400,&quot;message&quot;:&quot;Invalid request syntax. Visit http:\/\/www.teleduino.org for protocol reference.&quot;,&quot;response&quot;:[]}</p><p>I input the string you reference with my key inserted as show below (and shown in quotes so you can see the syntax)</p><p><a href="https://us01.proxy.teleduino.org/api/1.0/328.php?k=E388CF5348746D3951FC80C3E198759&r=getUptime" rel="nofollow">https://us01.proxy.teleduino.org/api/1.0/328.php?k...</a></p><p>&quot;https://us01.proxy.teleduino.org/api/1.0/328.php?k=E388CF5348746D3951FC80C3E198759&amp;r=getUptime&quot;</p><p>Any ideal what I can do to correct this?</p>
<p>Hi ThomasF5,</p><p>The key you've provided in the above example is only 31 characters, but should be 32 characters. Your problem was likely caused by a simple copy/paste error. I would recommend you register for a new key because the one you've displayed above is now public knowledge on the internet :)</p>
<p>hi, can anyone tell me how to use set serial, get serial, define serial and flush serial?? what im trying to do is that i want my teleduino to read the serial (im using mega 2560). i tried to define it first, then get serial but i get only empty. i dont know if i did it wrong or what. can help? or send me tutorial link for that. thanks</p>
<p>Hi <a href="http://www.instructables.com/member/eustacius" rel="nofollow">eustacius</a>,</p><p>It sounds like you've got the right idea from the API perspective. In regards to receiving the serial data, is the device that you're trying to collect the data from connected to the 'RX' pin and communicating as the same baud rate you defined in the defineSerial API call?</p>
<p>It's a very good idea, but it's to much instable.... You could send also on the serial monitor the connection status, not only on the led (pin 8)</p>
<p>Hi mosix. The stability often depends on your internet connection. You could tweak the code to output debug information to the serial port, however we wanted to keep the serial port free for projects.</p>
<p>I keep getting the following error message:</p><p>Teleduino328EthernetClientProxy.ino:15:26: fatal error: Teleduino328.h: No such file or directory</p><p>compilation terminated.</p><p>Error compiling.</p>
<p>Hi noel.kuck,</p><p>This would be the expected behaviour if you hadn't restarted the Arduino software after installed the library. Hope that helps!</p>
<p>Hi.</p><p>Looks like a great way of control. i read that there will be an addition for the WiFi shield. i just got myself the Mega and the Wifi shield thinking everything is doable either way...i had a look at the sketch and i'm sure it can be structured - but i am extremely new to the code!</p><p>Can anyone help me do the same setup using my WiFi shield? Most info i got on the board is that it is a SHIELD MODEL WIFI R3....</p><p>Looking forward to your responses!</p>
<p>Hi Bladder777,</p><p>I'm currently testing a version of the sketch for wifi. I'll get in touch with you to help you out.</p>
<p>i believe you've made contact with me via gmail..</p><p>Hope we can get it working and share with the community!</p>
<p>For wifi features you can use a portable wifi extender with an ethernet port, then you can put your arduino near extender everywhere in the house... </p>
<p>can you explain more?</p>
<p>Have you tried to link it through wifi instead of eathernet </p>
Hi oalharbi3. It's not officially supported (yet), but I understand that people have successfully adapted it to work with the wifi shield. The methods for the Wifi shield are a close match to the ethernet shield so it should be too difficult. We're currently developing an improved library with support for a far greater range of boards, including the ESP8266 and the Raspberry Pi. Please stay tuned!
<p>hi, </p><p>when I run the compilation of the sketch this message:</p><p><strong>Tama&ntilde;o binario del Sketch: 28.978 bytes (de un m&aacute;ximo de 28.672 bytes)</strong></p><p><strong>processing.app.debug.RunnerException: Sketch demasiado grande; ver <a href="http://www.arduino.cc/en/Guide/Troubleshooting#size" rel="nofollow"> http://www.arduino.cc/en/Guide/Troubleshooting#si...</a> para consejos de como reducirlo.</strong></p><p><strong>at processing.app.Sketch.size(Sketch.java:1653)</strong></p><p><strong>at processing.app.Sketch.build(Sketch.java:1586)</strong></p><p><strong>at processing.app.Sketch.build(Sketch.java:1562)</strong></p><p><strong>at processing.app.Editor$DefaultRunHandler.run(Editor.java:1899)</strong></p><p><strong>at java.lang.Thread.run(Thread.java:619)</strong></p><p><strong><br></strong></p><p><strong>arduino software version 1.0.6</strong></p><p><strong><br></strong></p><p>what i am doing wrong?</p><p>thanks</p><p><strong><br></strong></p>
<p>Hi Carlos, you are compiling a little bit big program than your device is made for. You have to reduce some sentences or avoid some routines.</p><p>Bye.</p>
<p>got {&quot;status&quot;:403,&quot;message&quot;:&quot;Key is offline or invalid.&quot;,&quot;response&quot;:[]} this msg..help me out kindly...</p>
<p>Hi ikumar5,</p><p>This message means one of two things. First off, please check to ensure that the key you're using is correct. Secondly, please check that your device is connecting successfully. Have you attached an LED to pin 8 to read the status output? This will provide clues as to whether or not the device is connecting to the server ok.</p><p>Hope that helps!</p>
thanx nathen it worksn one more thing am using teleduino cotroller app i want to read a sensor data but i am getting struck with that stuf could u help me how to read a data through the app..https://play.google.com/store/apps/details?id=appinventor.ai_ssslzc.Teleduino_Controller_Pro&amp;hl=en_GB this is tha app
<p>Hi ikumar5,</p><p>Great to hear you got it up and running. In regards to your question about the Teleduino Pro app, it's written by a third party and is not directly related to the Teleduino project. Please contact the author of the app with any questions. Thanks!</p>
<p>Hi, I have a strange problem. Initially everything was looking good, but suddenly the board does not complete the login. It stops after three flashes of the status LED. Regardless of this I get response when i send an instruction.</p><p>I even get an OK response when i have unplugged the board!!!</p><p>The response looks like this:</p><p>{&quot;status&quot;:200,&quot;message&quot;:&quot;OK&quot;,&quot;response&quot;:{&quot;result&quot;:1,&quot;time&quot;:0.042306900024414,&quot;values&quot;:[]}}</p><p>I get this regardless of which instruction I send.</p><p>In this case I asked for &quot;getAllInputs&quot;...</p><p>Any ideas on how this can happen?</p><p>Regards from Leif in Sweden</p>
<p>Hi Leif,</p><p>This is definitely strange. I suspect the response you're seeing is a result of a browser cache? It should definitely not return 'OK' if the device is not connected.</p><p>Failing after 3 flashes indicates that your device is failing to connect to the server. I would suggest trying a different MAC address (so that your router will see it as a new device), and possibly even trying changing the serverPort value in the sketch (the server listens on ports 53 and 5353).</p><p>If you continue to experience trouble, feel free to contact me directly for further diagnosis.</p>
Hi <br>Cant upload the sketch to the arduino rev 3 <br>error say: <br>teleduino was not declared in this scope <br> <br>what i am doing wrong? <br> Thanks
fix it,it was not in right dir. <br>Load up ok now. <br>Next i change the mac address and copy the coded key in place of the zeros. did not change any of the ip numbers or subnet. <br> but now i cant connect to: <br>https://us01.proxy.teleduino.org/api/1.0/328.php?k={key}&amp;r=getVersion <br>and yes i change the key. <br>I know it me lol i am realy new in arduino but love to have this working <br> <br>Regards Lope 12
Hi All. <br>Forget all my questions ask. <br>it works like a champ now. <br>i did all ok but ms explorer dont display the text from server, just want me to download or open it. <br>Use chrome now and all works like it should. <br> <br>Perfect Thanks <br>Regards Lope
Hi Lope, <br> <br>Thanks for the confirmation. Great to hear you got it working! <br> <br>Thanks, <br>Nathan.
Hi Lope12, <br> <br>That error would occur for one of two reasons: <br>1) The library is not in the correct libraries folder, or <br>2) The Arduino software was not restarted after copying the library into the libraries folder <br> <br>Let me know if you continue to have trouble after checking those two points. <br> <br>Thanks! <br>Nathan
Sorry I forgot the error message. &quot;Website Declined to show this Webpage&quot; <br>Most likely cause - Website requires you to log in<br><br>What should I see if I can get to site?<br><br>Do you know of a customisable webpage that will work with Teleduino to give realtime feedback on input/outputs &amp; allow remote readings and configuration?<br>The reason I ask is I would like to remotely monitor voltages of a battery bank, get alerts when issues arise &amp; even start/stop a generator if solar input is too low.<br><br>Cheers,<br>Bruce
Hi Bruce, <br> <br>If you use a different browser (such as Google Chrome), or turn off the friendly HTTP error pages in Internet Explorer then you should be able to see the response in full. <br> <br>I know of people that have successfully integrated with Cosm and ThingSpeak, as well as custom applications for doing monitoring and control. There is also an unofficial Android app available to operating your Teleduino.
Where can I download the sketch? I can't see a link in the Instructable. <br>Thanks, <br>Bruce
Hi Bruce.<br> <br> Thanks for the comment. Once you've installed the library (Step 3) and restarted the application, the sketches are listed under the examples.<br> <br> <em>Open up the Arduino IDE. Click 'File' -&gt; 'Examples' -&gt; 'Teleduino328' -&gt; 'TeleduinoEthernetClientProxy'. This will open up the sketch that we'll be using.</em><br> <br> Thanks!
Hi Nathan,<br><br>Thanks for clarifying that. I can now see the TeleduinoEthernetClientProxy in Examples. I opened sketch and loaded my Teleduino code that I got from their site.<br>I did not change any other settings. I the plugged Arduino Uno Ethernet shield into my ADSL2+ router which is connected to Internet.<br><br>I copy &amp; pasted the Teleduino URL shown in Instructable inserting my key (the original one, not the one generated to enter into sketch.<br>When I enter on this https://us01.proxy.teleduino.org/api/1.0/328.php?k={F06EB5D9B8CFF1C5972CAA934E89D53E<br>}&amp;r=getVersion I get error that can't show site.<br><br>Any idea why I can't connect to Teleduino? Could it be blocked by my Billion 7404VNPX router?<br>Cheers..Bruce
Hi Bruce. <br> <br>It sounds like you're seeing 'friendly HTTP status errors' in Internet Explorer. <br> <br>The underlying problem, however, is that your device is not connected to the Teleduino cloud service. Have you connected a status LED to pin 8? This will flash codes during startup which helps with troubleshooting.

About This Instructable

118,107views

183favorites

License:

Bio: Developer of the telecontrol and telemonitoring system Teleduino, using the Arduino platform.
More by nathanknz:Control Servos over the Internet via Arduino with Teleduino Read Light Level over the Internet via Arduino with Teleduino Control a Relay over the Internet via Arduino with Teleduino 
Add instructable to: