Arduino Control via a Web Service With Teleduino

download Arduino Control via a Web Service With Teleduino

of 19

description

pogt

Transcript of Arduino Control via a Web Service With Teleduino

  • Convert your Arduino into a sofisticated web control platform usingTeleduino.

    Teleduino is both a product and a service. Once the Teleduino sketch has beenloaded on your Arduino (the 'product'), it then connects to the Teleduino serverawaiting your instruction from anywhere in the world via the internet (the'service').

    Typically there are no firewall changes required, and if your network supportsDHCP then no network configuration is needed on the device. Easy!

    The Teleduino platform allows you to perform the following with your Arduino, allvia the internet:

    Reset, ping, get version, get uptime, get free memory.Define pin modes, set digital outputs, set analog outputs, read digital inputs,read analog inputs, or read all inputs with a single API call.Define up to 2 'banks' (4 for the Mega) of shift registers. Each 'bank' can

    (http://cdn.instructables.com/F80/V5IK/H19RSZ5Q/F80V5IKH19RSZ5Q.LARGE.jpg)

    About This Instructable

    License:64,943 views

    125 favorites

    (/member/nathanknz/)

    nathanknz (/member/nathanknz/)

    Follow

    Developer of the telecontrol andtelemonitoring system Teleduino, using theArduino platform.

    44

    Bio:

    (/id/Read-Light-Level-over-the-Internet-via-Arduino-wit)

    (/id/Control-Servos-over-the-Internet-via-Arduino-with-)

    (/id/Control-an-LED-over-the-Internet-via-Arduino-with-)

    More by nathanknz

    teleduino (/tag/type-id/category-technology/keyword-

    teleduino/)

    arduino (/tag/type-id/category-technology/keyword-

    arduino/)

    iot (/tag/type-id/category-technology/keyword-iot/)

    internet of things (/tag/type-id/category-technology

    /keyword-internet of things/)

    Tags:

    Arduino Control via a Web Service with Teleduino by nathanknz (/member/nathanknz/)

    Collection I Made it!

    Download (/id/Arduino-Control-via-a-Web-Service-with-Teleduino/?download=pdf)

    5 Steps

    Favorite Share

    (/id/Arduino-Control-via-a-Web-Service-with-Teleduino/)

    (/)

    (/)

    Explore (/tag/type-id/) Create (/about/submit.jsp) Contests (/contest/) Community (/community/)Login (/account/login) | Sign Up (/account/gopro?sourcea=header)

    Arduino Control via a Web Service with Teleduino http://www.instructables.com/id/Arduino-Control-via-a-Web-Service-wi...

    1 of 18 9/20/2014 5:38 PMPrint to PDF without this message by purchasing novaPDF (http://www.novapdf.com/)

  • contain up to 32 cascaded shift registers, giving a total of 512 digital outputs(1024 for the Mega).Shift register outputs can be set, or merged, and expire times can be set onmerges (you could set an output(s) high for X number of milliseconds).Define, and read and write from serial port (4 for the Mega).Read and write from EEPROM.Define and position up to 6 servos (48 for the Mega).Set preset values for the above functions, which get set during boot. Presetvalues are stored in the first 178 bytes of the EEPROM (413 for the Mega).

    Just imagine what you can do. The possibilities are endless. What makes it evenbetter? The process is quick and easy.

    This tutorial will guide you through creating a Status LED for your device, thenobtaining and uploading the Teleduino library/sketch to your ethernet enabledArduino Uno (or equivalent).

    To complete this tutorial you need:Arduino Uno / Mega (or equivalent)Ethernet Sheild (Wiznet based)LED1K Resistor (or similar)

    This is our first tutorial and will be adding neat project tutorials for achievingspecific tasks.

    If you get stuck on any of the steps, or if you feel that there is a step that couldbe explained better, please leave a comment so that we can improve things.

    Enjoy!

    Step 1: Obtain Unique API Key

    In order to uniquely identify your device on the Teleduino server, you need toobtain a unique API key.

    This API key needs to be loaded into the Arduino sketch (explained in Step 4).

    Your key will be sent to you by email within a few minutes of being requested.

    To request a key, hop over to https://www.teleduino.org/tools/request_key.php(https://www.teleduino.org/tools/request_key.php) (please bear with us while thenice looking site is being built!)

    Cheers!

    Related

    See More (/tag/type-id/?q=)

    Control Servos over theInternet via Arduino withTeleduino (/id/Control-Servos-over-the-Internet-via-Arduino-with-/)Read Light Level over theInternet via Arduino withTeleduino (/id/Read-Light-Level-over-the-Internet-via-Arduino-wit/)Control a Relay over theInternet via Arduino withTeleduino (/id/Control-a-Relay-over-the-Internet-via-Arduino-with/)Control an LED over theInternet via Arduino withTeleduino (/id/Control-an-LED-over-the-Internet-via-Arduino-with-/)APDuinOS (Flashing) --arduino IoT (internet ofthings) -- aquaponicapplication (/id/APDuinOS-Flashing-arduino-

    Arduino Control via a Web Service with Teleduino http://www.instructables.com/id/Arduino-Control-via-a-Web-Service-wi...

    2 of 18 9/20/2014 5:38 PMPrint to PDF without this message by purchasing novaPDF (http://www.novapdf.com/)

  • Step 2: Add Status LED to Arduino

    While your Teleduino device is booting, it flashes codes out the Status LED. Thisis so that you can keep an eye on what's happening, and it also makestroubleshooting easier if you're having trouble getting connected.

    The different status codes are:1 flash - Initialising2 flashes - Starting network3 flashes - Connecting to server4 flashes - Authenticated5 flashes - Session already exists for supplied key (sometimes happens after aquick restart - will work on next auto-restart)6 flashes - Invalid or unauthorised key10 flashes - Connection dropped

    The Status LED is preconfigured on digital pin 8 of the Arduino board. In order tosee status codes being flashed, we need an LED connected.

    Solder the 1K resistor onto the flat-edge side of the LED. You may wish toshorten the leads (as per image) .

    Bend the leads for the resistor / LED so that they are spaced far enough apartfor the resistor lead to fit in the GND port, and the LED lead to fit in the pin 8 port

    (http://cdn.instructables.com/F7R/BI2L/H19RHELE/F7RBI2LH19RHELE.LARGE.jpg)

    (http://cdn.instructables.com/F80/V5IK/H19RSZ5Q/F80V5IKH19RSZ5Q.LARGE.jpg)

    (http://cdn.instructables.com/F8F/FM77/H1AH6AX1/F8FFM77H1AH6AX1.LARGE.jpg)

    Arduino Control via a Web Service with Teleduino http://www.instructables.com/id/Arduino-Control-via-a-Web-Service-wi...

    3 of 18 9/20/2014 5:38 PMPrint to PDF without this message by purchasing novaPDF (http://www.novapdf.com/)

  • (as per image). Trim any excess lead so that it looks nice and tidy.

    Connect your masterpiece to your Arduino.

    Nice work!

    Step 3: Download Teleduino Library

    Teleduino comes in the form of a library for your Arduino IDE (the software thatyou use to write/upload sketches to your Arduino). The library is written forversions 1.0 and 1.0.1 of the IDE (the latest versions at the time of writing).

    Download the library from https://www.teleduino.org/downloads/arduino/teleduino328_328-0.6.9.zip (https://www.teleduino.org/downloads/arduino/teleduino328_328-0.6.9.zip) for the Uno version, or https://www.teleduino.org/downloads/arduino/teleduino2560_2560-0.1.2.zip (https://www.teleduino.org/downloads/arduino/teleduino2560_2560-0.1.2.zip) for the Mega version.

    Once downloaded, open up the archive and you'll see a folder called'Teleduino328' ('Teleduino2560' for the Mega). Copy this folder to the 'libraries'folder of your Arduino IDE installation.

    Important Note: If you have the Arduino software open at this point, youwill need to close it and restart it. If you don't, the library will not beavailable and you'll get compilation errors!

    Good job!

    Step 4: Upload Sketch to the Arduino

    (http://cdn.instructables.com/FL1/0L84/H19RQQVK/FL10L84H19RQQVK.LARGE.jpg)

    Arduino Control via a Web Service with Teleduino http://www.instructables.com/id/Arduino-Control-via-a-Web-Service-wi...

    4 of 18 9/20/2014 5:38 PMPrint to PDF without this message by purchasing novaPDF (http://www.novapdf.com/)

  • Now for the moment we've all been waiting for. Time to make some magichappen 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'refeeling adventurous you can play with these, but the default should work fine.The only thing we recommend changing is the MAC address declaration, even ifit's just a matter of changing the last byte to something like 0x01. MACaddresses must be unique on your network (which is why we recommend youchange it from the default). If you are setting up two or more Teleduino devices,

    (http://cdn.instructables.com/F1X/FQ8I/H19RQQVJ/F1XFQ8IH19RQQVJ.LARGE.jpg)

    (http://cdn.instructables.com/FQY/DOAE/H19RUYJX/FQYDOAEH19RUYJX.LARGE.jpg)

    Arduino Control via a Web Service with Teleduino http://www.instructables.com/id/Arduino-Control-via-a-Web-Service-wi...

    5 of 18 9/20/2014 5:38 PMPrint to PDF without this message by purchasing novaPDF (http://www.novapdf.com/)

  • you must ensure their MAC addresses are different.

    The one thing that must be set is the unique key. See the attached image as areference. By default they are set to a bunch of zeros. To make it easier, whenyou receive your unique API key, you'll also receive a URL to a tool whichoutputs 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 thecorrect serial port is selected, and click 'Upload'. All going well the sketch willcompile and upload.

    Viola!

    Step 5: Sample API Calls and Further Reading

    By this stage you should have a functional Teleduino device. Connect up anethernet cable, supply power, and your device should connect to the Teleduinoserver. Follow the Status LED to watch the connection process.

    During normal operation, the Status LED will do a quick pulse every 5 secondsof inactivity. This is the server checking in on the device to make sure everythingis happy.

    So, you've got a connected Teleduino. Now what? I bet you want to do somecool stuff with it, right? Let's start with a couple of really simple API calls. TheseAPI calls will tell you what version of the Teleduino firmware you're running, andthe uptime of your device (in milliseconds).

    Try out the following URLs (replace {key} with your unique API key):For the Uno:https://us01.proxy.teleduino.org/api/1.0/328.php?k={key}&r=getVersionhttps://us01.proxy.teleduino.org/api/1.0/328.php?k={key}&r=getUptimeFor the Mega:https://us01.proxy.teleduino.org/api/1.0/2560.php?k={key}&r=getVersionhttps://us01.proxy.teleduino.org/api/1.0/2560.php?k={key}&r=getUptime

    Pretty neat, huh?

    This is where we end the tutorial. We are continuing to add further tutorials

    (http://cdn.instructables.com/FRB/J2E5/H1AH6MFN/FRBJ2E5H1AH6MFN.LARGE.jpg)

    Arduino Control via a Web Service with Teleduino http://www.instructables.com/id/Arduino-Control-via-a-Web-Service-wi...

    6 of 18 9/20/2014 5:38 PMPrint to PDF without this message by purchasing novaPDF (http://www.novapdf.com/)

  • Make Comment

    (/member/Prodigal_Son/)

    1 year ago Reply (CK7T6GSHD4VNRLQ)

    (/member/Tchernyavsky/)

    6 months ago Reply (CYR8LYWHT2BW275)

    which explain how to achieve specific tasks using the Teleduino platform. Thesetutorials are:

    Control an LED over the Internet via Arduino with Teleduino(http://www.instructables.com/id/Control-an-LED-over-the-Internet-via-Arduino-with-/)Control a Relay over the Internet via Arduino with Teleduino(http://www.instructables.com/id/Control-a-Relay-over-the-Internet-via-Arduino-with/)Read Light Level over the Internet via Arduino with Teleduino(http://www.instructables.com/id/Read-Light-Level-over-the-Internet-via-Arduino-wit/)Control Servos over the Internet via Arduino with Teleduino(http://www.instructables.com/id/Control-Servos-over-the-Internet-via-Arduino-with-/)

    If you want to dive right in yourself, you can view the full API reference manualat https://www.teleduino.org/documentation/api (https://www.teleduino.org/documentation/api).

    Your comments and questions are welcome and appreciated.

    Have fun!

    1-40 of65

    Next (http://www.instructables.com/id/Arduino-Control-via-a-Web-Service-with-Teleduino/?&sort=ACTIVE&limit=40&offset=40#DISCUSS)

    Prodigal_Son (/member/Prodigal_Son/)

    I just wanted to say that you can download an early version of Teleduino Controllerfor Android devices on Google Play :https://play.google.com/store/apps/details?id=appinventor.ai_ssslzc.Teleduino_Controller(https://play.google.com/store/apps/details?id=appinventor.ai_ssslzc.Teleduino_Controller)

    And like the info says, if you miss any functions please contact me and I will try toadd it in future releases.

    Tchernyavsky (/member/Tchernyavsky/)

    Hello! I have this problem: Everything works well until the power is in charge ofArduino. But if you turn the power off and back on, the connection to the serverTeledyne not happening! The led is burning. If you press the reset button on theBoard, then everything begins to work as it should! What you need to do to whenpower is turned off,then I could then press the button on the Board. Thank you!

    bclagett (/member/bclagett/)

    Can new values for variables (as set temps in a thermostat) be sent to the

    Arduino Control via a Web Service with Teleduino http://www.instructables.com/id/Arduino-Control-via-a-Web-Service-wi...

    7 of 18 9/20/2014 5:38 PMPrint to PDF without this message by purchasing novaPDF (http://www.novapdf.com/)

  • 6 months ago Reply (CM7RLLPHT216FCL)

    (/member/bclagett/)

    (/member/Dr_L/)

    6 months ago Reply (CWNNDGFHSM51HR7)

    (/member/ikumar5/)

    7 months ago Reply (CH6L7FTHRWNAEPM)

    (/member/nathanknz/)

    6 months ago Reply (CAO25CAHS18B33T)

    (/member/ikumar5/)

    6 months ago Reply (C2IO6M9HS18CORR)

    (/member/nathanknz/)

    6 months ago Reply (C90A69JHS18INBF)

    Arduino?

    Dr_L (/member/Dr_L/)

    The ethernet shield is based on the W5100 ic. By any chance, was anyone able tomake teleduino work using the much cheaper ENC28J60 ethernet controller chip?

    ikumar5 (/member/ikumar5/)

    got {"status":403,"message":"Key is offline or invalid.","response":[]} this msg..helpme out kindly...

    nathanknz (/member/nathanknz/) (author) ikumar5

    Hi ikumar5,

    This message means one oftwo things. First off, pleasecheck to ensure that the keyyou're using is correct.Secondly, please check thatyour device is connectingsuccessfully. Have youattached an LED to pin 8 toread the status output? This willprovide clues as to whether ornot the device is connecting tothe server ok.

    Hope that helps!

    ikumar5 (/member/ikumar5/) nathanknz

    thanx nathen it worksn one morething am using teleduino cotrollerapp i want to read a sensor data buti am getting struck with that stufcould u help me how to read a datathrough theapp..https://play.google.com/store/apps/details?id=appinventor.ai_ssslzc.Teleduino_Controllerhl=en_GB this is tha app

    nathanknz (/member/nathanknz/) (author) ikumar5

    Hi ikumar5,

    Great to hear you got it up andrunning. In regards to yourquestion about the TeleduinoPro app, it's written by a thirdparty and is not directly relatedto the Teleduino project. Pleasecontact the author of the appwith any questions. Thanks!

    Arduino Control via a Web Service with Teleduino http://www.instructables.com/id/Arduino-Control-via-a-Web-Service-wi...

    8 of 18 9/20/2014 5:38 PMPrint to PDF without this message by purchasing novaPDF (http://www.novapdf.com/)

  • (/member/Dunes2/)

    6 months ago Reply (C4GJR6RHRWNH9DQ)

    (/member/nathanknz/)

    6 months ago Reply (CVZKYH4HS18B3J9)

    (/member/wasimxxl/)

    10 months ago Reply (CER20ZUHN827VTY)

    (/member/lope12/)

    1 year ago Reply (CQ84V4UHLA27BOV)

    Dunes2 (/member/Dunes2/)

    Hi, I have a strange problem. Initially everything was looking good, butsuddenly the board does not complete the login. It stops after three flashesof the status LED. Regardless of this I get response when i send aninstruction.

    I even get an OK response when i have unplugged the board!!!

    The response looks like this:

    {"status":200,"message":"OK","response":{"result":1,"time":0.042306900024414,"values":[]}}

    I get this regardless of which instruction I send.

    In this case I asked for "getAllInputs"...

    Any ideas on how this can happen?

    Regards from Leif in Sweden

    nathanknz (/member/nathanknz/) (author) Dunes2

    Hi Leif,

    This is definitely strange. Isuspect the response you'reseeing is a result of a browsercache? It should definitely notreturn 'OK' if the device is notconnected.

    Failing after 3 flashes indicatesthat your device is failing toconnect to the server. I wouldsuggest trying a different MACaddress (so that your router willsee it as a new device), andpossibly even trying changingthe serverPort value in thesketch (the server listens onports 53 and 5353).

    If you continue to experiencetrouble, feel free to contact medirectly for further diagnosis.

    wasimxxl (/member/wasimxxl/)

    can any one help me please ??

    i wont to use arduino in my project ..i wont ardino send alarm to my androin phone 'by internet ' whin the Bell home isringWhat are the pieces that will I need ??remember by internet no IRir no blotooththank you

    lope12 (/member/lope12/)

    HiCant upload the sketch to the arduino rev 3error say:teleduino was not declared in this scope

    what i am doing wrong?

    Arduino Control via a Web Service with Teleduino http://www.instructables.com/id/Arduino-Control-via-a-Web-Service-wi...

    9 of 18 9/20/2014 5:38 PMPrint to PDF without this message by purchasing novaPDF (http://www.novapdf.com/)

  • (/member/lope12/)

    1 year ago Reply (CQF6UCLHLA27C6U)

    (/member/lope12/)

    1 year ago Reply (CJFN8XVHLA27CN2)

    (/member/nathanknz/)

    1 year ago Reply (CL25Z1JHLFUXG87)

    (/member/nathanknz/)

    1 year ago Reply (CWUCPH5HLA1V4GO)

    Thanks

    lope12 (/member/lope12/) lope12

    fix it,it was not in right dir.Load up ok now.Next i change the mac address and copy the coded key in place of thezeros. did not change any of the ip numbers or subnet.but now i cant connect to:https://us01.proxy.teleduino.org/api/1.0/328.php?k={key}&r=getVersionand yes i change the key.I know it me lol i am realy new in arduino but love to have this working

    Regards Lope 12

    lope12 (/member/lope12/) lope12

    Hi All.Forget all my questions ask.it works like a champ now.i did all ok but ms explorer dont display the text from server, just want me todownload or open it.Use chrome now and all works like it should.

    Perfect ThanksRegards Lope

    nathanknz (/member/nathanknz/) (author) lope12

    Hi Lope,

    Thanks for the confirmation. Greatto hear you got it working!

    Thanks,Nathan.

    nathanknz (/member/nathanknz/) (author) lope12

    Hi Lope12,

    That error would occur for one oftwo reasons:1) The library is not in the correctlibraries folder, or2) The Arduino software was notrestarted after copying the libraryinto the libraries folder

    Let me know if you continue tohave trouble after checkingthose two points.

    Thanks!Nathan

    bruiser69 (/member/bruiser69/)

    Sorry I forgot the error message. "Website Declined to show this Webpage"Most likely cause - Website requires you to log in

    Arduino Control via a Web Service with Teleduino http://www.instructables.com/id/Arduino-Control-via-a-Web-Service-wi...

    10 of 18 9/20/2014 5:38 PMPrint to PDF without this message by purchasing novaPDF (http://www.novapdf.com/)

  • 1 year ago Reply (C8Y34VYHJKC2ECV)

    (/member/bruiser69/)

    (/member/nathanknz/)

    1 year ago Reply (C3XN6B9HJKC2NHM)

    (/member/bruiser69/)

    1 year ago Reply (CXXOKI9HJKC2D9P)

    (/member/nathanknz/)

    1 year ago Reply (CA8GHYPHJKC2DHN)

    What should I see if I can getto site?

    Do you know of acustomisable webpage thatwill work with Teleduino to giverealtime feedback oninput/outputs & allow remotereadings and configuration?The reason I ask is I would liketo remotely monitor voltages ofa battery bank, get alerts whenissues arise & even start/stopa generator if solar input is toolow.

    Cheers,Bruce

    nathanknz (/member/nathanknz/) (author) bruiser69

    Hi Bruce,

    If you use a different browser(such as Google Chrome), or turnoff the friendly HTTP error pagesin Internet Explorer then youshould be able to see theresponse in full.

    I know of people that havesuccessfully integrated withCosm and ThingSpeak, as wellas custom applications for doingmonitoring and control. There isalso an unofficial Android appavailable to operating yourTeleduino.

    bruiser69 (/member/bruiser69/)

    Where can I download the sketch? I can't see a link in the Instructable.Thanks,Bruce

    nathanknz (/member/nathanknz/) (author) bruiser69

    Hi Bruce.

    Thanks for the comment. Onceyou've installed the library (Step3) and restarted the application,the sketches are listed under theexamples.

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

    Arduino Control via a Web Service with Teleduino http://www.instructables.com/id/Arduino-Control-via-a-Web-Service-wi...

    11 of 18 9/20/2014 5:38 PMPrint to PDF without this message by purchasing novaPDF (http://www.novapdf.com/)

  • (/member/bruiser69/)

    1 year ago Reply (CUMGIREHJKC2DSE)

    (/member/nathanknz/)

    1 year ago Reply (CW3GQ2JHJKC2NG0)

    (/member/dslrmotion/)

    1 year ago Reply (C2VP08WHFPTJ8VP)

    Thanks!

    bruiser69 (/member/bruiser69/) nathanknz

    Hi Nathan,

    Thanks for clarifying that. I can nowsee the TeleduinoEthernetClientProxyin Examples. I opened sketch andloaded my Teleduino code that I gotfrom their site.I did not change any other settings. Ithe plugged Arduino Uno Ethernetshield into my ADSL2+ router which isconnected to Internet.

    I copy & pasted the Teleduino URLshown in Instructable inserting my key(the original one, not the onegenerated to enter into sketch.When I enter on thishttps://us01.proxy.teleduino.org/api/1.0/328.php?k={F06EB5D9B8CFF1C5972CAA934E89D53E}&r=getVersion I get error that can'tshow site.

    Any idea why I can't connect toTeleduino? Could it be blocked by myBillion 7404VNPX router?Cheers..Bruce

    nathanknz (/member/nathanknz/) (author) bruiser69

    Hi Bruce.

    It sounds like you're seeing'friendly HTTP status errors' inInternet Explorer.

    The underlying problem,however, is that your device isnot connected to the Teleduinocloud service. Have youconnected a status LED to pin 8?This will flash codes duringstartup which helps withtroubleshooting.

    dslrmotion (/member/dslrmotion/)

    Everything works as explained in the tutorials. Thanks for all the hard workdeveloping this service. Would love more tutorials in the future if you ever findtime. I do have one question. Not sure if I should ask here but I will anyway. I havetwo Teleduino's hooked up at the same time from two different ports from myrouter and they seem to conflict with each other. What steps would I take toeliminate this problem? Thanks again for unlimited future projects. Joe

    nathanknz (/member/nathanknz/) (author) dslrmotion

    Hi dslrmotion,

    Arduino Control via a Web Service with Teleduino http://www.instructables.com/id/Arduino-Control-via-a-Web-Service-wi...

    12 of 18 9/20/2014 5:38 PMPrint to PDF without this message by purchasing novaPDF (http://www.novapdf.com/)

  • 1 year ago Reply (CBM7FC3HFPTIHRT)

    (/member/nathanknz/)

    (/member/siddiqov/)

    1 year ago Reply (C19ECE0HFSHU8IN)

    (/member/nathanknz/)

    1 year ago Reply (CIKG6VHHFPTIHR5)

    Thanks for the kindwords!

    There is no limit tohow many devicesyou can run on thesame network (andyou can run themall with the sameserverPort). Youjust need to ensurethat the mac[]variable is differentfor each device,and if you're notusing DHCP (it isenabled bydefault), then you'llneed to set uniquenetwork settings forthe device.

    Thanks!

    siddiqov (/member/siddiqov/)

    Hi again,I have tried many times and wonder about TeleduinoEthernetClientProxy sketch.if i upload it as it is except replace the key, it works. But as i make some changeeven a single statement of declaring a variable e.g. int pin=4; it generate error ofthe following{"status":403,"message":"Key is offline or invalid.","response":[]}. if i remove thecustomize code it starts working again. Why is it exhibiting such behavior?

    nathanknz (/member/nathanknz/) (author) siddiqov

    Hi siddiqov,

    Adding custom code shouldn'tcause any problems unless itexceeds the devices flash memoryor volatile memory (SRAM).

    The 403 is a response given bythe server if either the key isincorrect or device has notconnected to the server.

    If you're having trouble gettingyour device to connect to theserver, I would recommendconnecting a status LED to pin 8and checking at which stage theconnection is failing - this wouldhelp to find a solution.

    Thanks!

    siddiqov (/member/siddiqov/)

    Hi NatahnKnz,

    Arduino Control via a Web Service with Teleduino http://www.instructables.com/id/Arduino-Control-via-a-Web-Service-wi...

    13 of 18 9/20/2014 5:38 PMPrint to PDF without this message by purchasing novaPDF (http://www.novapdf.com/)

  • 1 year ago Reply (CHJWMCNHFSH593S)

    (/member/siddiqov/)

    (/member/nathanknz/)

    1 year ago Reply (CQ3N7EWHFPTIEKF)

    (/member/siddiqov/)

    1 year ago Reply (COQEIJMHFSHU3YM)

    there is an example of fading.i want to run it throughteleduino. but don't know howto do it. the example is usingpin 9 for the LED, i can turn iton and off through teleduinobut how to pass loopcontrolling variables. will bevery grateful to you in thisregards.the code is herefor(int fadeValue = 0 ;fadeValue = 0; fadeValue-=5) {// sets the value (range from0 to 255):analogWrite(ledPin,fadeValue);// wait for 30 milliseconds tosee the dimming effectdelay(30);

    nathanknz (/member/nathanknz/) (author) siddiqov

    Hi siddiqov,

    Unfortunately fading is notnatively supported in the standardTeleduino library.

    You could, however, add the extracode to the library. TheanalogWrite function is beingcalled at line 332 of theTeleduino328 library (version328-0.6.7).

    Thanks!

    siddiqov (/member/siddiqov/) nathanknz

    Thank you. how about if i send request to turn on PIN 4 and then in theloop i start checking in if(pin==0n){ then do my fading coding}else{donothing}ORif (pin4==ON){set pin5 highset pin6 highdelay();}

    Arduino Control via a Web Service with Teleduino http://www.instructables.com/id/Arduino-Control-via-a-Web-Service-wi...

    14 of 18 9/20/2014 5:38 PMPrint to PDF without this message by purchasing novaPDF (http://www.novapdf.com/)

  • (/member/nathanknz/)

    1 year ago Reply (CP1RGN7HFPTIHR2)

    (/member/siddiqov/)

    1 year ago Reply (CRHUAGAHFPTIFGM)

    (/member/siddiqov/)

    1 year ago Reply (CZRGCBTHFSH590Q)

    (/member/nathanknz/)

    1 year ago Reply (CEOUGLFHFPTIEKC)

    something like that.is it possible to handle multiple pins while in one go.Best regards

    nathanknz (/member/nathanknz/) (author) siddiqov

    Hi siddiqov,

    An override like you've suggestedshould work fine.If you just want to replicate theoutput of one pin to another, thefollowing would probably work(untested):digitalWrite(5, digitalRead(4));Just make sure you have the pinmodes set to OUTPUT.

    Thanks,Nathan.

    siddiqov (/member/siddiqov/) nathanknz

    Hi Nathanknz,I used fade example for my two linear actuator to extract and retractsimultaneously just like to open a box top at both ends and found that frompin 1-8 doesn't activating the linear actuators although i have checked withleds and serial monitors and both are showing that PINS are responding.but as i attached these linear actuators with pin 9 and on-wards, these areactivating the actuators. just posting my stupid experiences to helpsomeone who face same things in future.

    siddiqov (/member/siddiqov/)

    Hi NathanKnz,I want to set more then one pin on for a specific time, but don't know how to do it inone go. there is a URL but only for only one pin like pin 4.https://us01.proxy.teleduino.org/api/1.0/328.php?k=F37CF622F3DAE9AA3ACAE643177A93C7&r=setDigitalOutput&pin=4&output=1&expire_time=10000

    nathanknz (/member/nathanknz/) (author) siddiqov

    Hi siddiqov,

    Thanks again for your comments.

    Your question was actually verywell timed! In the current versionof the firmware (328-0.6.7) youare not able to set multipleoutputs with a single API call, butI'm currently testing the nextversion (328-0.6.8) whichsupports exactly that! It should bereleased within the next couple ofweeks once I'm satisfied that it'stested out fine.

    Setting multiple outputs on a shiftregister is already supported via a

    Arduino Control via a Web Service with Teleduino http://www.instructables.com/id/Arduino-Control-via-a-Web-Service-wi...

    15 of 18 9/20/2014 5:38 PMPrint to PDF without this message by purchasing novaPDF (http://www.novapdf.com/)

  • (/member/siddiqov/)

    1 year ago Reply (C6BYMKSHFPTHA20)

    (/member/nathanknz/)

    1 year ago Reply (CNNK198HFWST841)

    (/member/siddiqov/)

    1 year ago Reply (C9VLKJOHFPTE8GK)

    (/member/nathanknz/)

    1 year ago Reply (CYNHY2LHFPTGFKW)

    single API call, but requires further components.

    Thanks!Nathan.

    siddiqov (/member/siddiqov/)

    Thank you Nathanknz, the problem in my case was an older version of arduinoIDE. when i upgrade it to 1.0.1, every things went perfect.

    nathanknz (/member/nathanknz/) (author) siddiqov

    Hi siddiqov,Thanks for reporting back, andgreat to hear you got it working.Thanks for using Teleduino!

    siddiqov (/member/siddiqov/)

    I uploaded the TeleduinoEhternetClientPoroxy sketch and set my key, obtained viaemail, but when i tried the following linkhttps://us01.proxy.teleduino.org/api/1.0/328.php?k=0D8554078235C27AD714A83F08D0DE31&r=getUptimegot the following response{"status":403,"message":"Key is offline or invalid.","response":[]}

    please let me know where am i wrong. I am pasting my code where i have donesme changesbyte useDhcp = true;byte useDns = true;byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xAE, 0xED };IPAddress deviceIp(192, 168, 0, 100); // Only if useDhcp is falseIPAddress gatewayIp(192, 168, 0, 1); // Only if useDhcp is falseIPAddress dnsIp(192, 168, 0, 1); // Only if useDhcp is falseIPAddress subnet(255, 255, 255, 0); // Only if useDhcp is falseIPAddress serverIp(173, 230, 152, 173); // Only if useDns is falsechar serverName[] = "us01.proxy.teleduino.org"; // Only if useDns is trueunsigned int serverPort = 5353; // Can be set to either 53 or 5353byte statusLedPin = 8;

    // User configurable key, this is used to authenticate with the proxy server// This is checked against the EEPROM on boot and written if necessary// The proxy server retreives the key from the EEPROMbyte key[] = { 0x0D, 0x85, 0x54, 0x07,0x82, 0x35, 0xC2, 0x7A,0xD7, 0x14, 0xA8, 0x3F,0x08, 0xD0, 0xDE, 0x31 };

    nathanknz (/member/nathanknz/) (author) siddiqov

    Hi siddiqov,

    Looking at your code everythinglooks fine. The error your gettingis most likely because somethingis preventing your device fromconnecting to the server(possibly firewall).

    You can try changing theserverPort variable to 53. If you

    Arduino Control via a Web Service with Teleduino http://www.instructables.com/id/Arduino-Control-via-a-Web-Service-wi...

    16 of 18 9/20/2014 5:38 PMPrint to PDF without this message by purchasing novaPDF (http://www.novapdf.com/)

  • (/member/siddiqov/)

    1 year ago Reply (C153XEYHFPTGQSX)

    (/member/nathanknz/)

    1 year ago Reply (C9FV82IHFPTEC2V)

    (/member/siddiqov/)

    1 year ago Reply (CM2NNMCHFSHEBGG)

    continue to experience problems, take note of what status the status LEDis indicating that you're getting up to. This will help to troubleshoot wherethe issue is.

    On a side note, you may want to request a new API key since you havepublished this one in a public forum :) Just fill in the form again and a newkey will be sent to you.

    Thanks for trying Teleduino!

    siddiqov (/member/siddiqov/) nathanknz

    Thank you for the quick response, Nathanknz. I tried and attached thestatus LED with 1 k resistor and a new key. The LED didn't even a singleflash, though there are many others build-in LED on Ethernet shield, someof them are blinking while two of them are constantly on. Moreover Ichecked the Status LED with simple Arduino LED sketch and it works. stillgetting the same error.{"status":403,"message":"Key is offline or invalid.","response":[]}when i tried the following URLhttps://us01.proxy.teleduino.org/api/1.0/328.php?k={MY KEY}&r=getUptime

    i have tried with replacing 5353 with just 53 as well and get the status quo.

    nathanknz (/member/nathanknz/) (author) siddiqov

    Hi siddiqov,

    It's very bizarre that you're notgetting anything on the statusLED, because even if you didn'thave the ethernet shield attachedyou should still at least see astatus flash of '1 - pause - 2', andthen it should eventually time outand fail and flash '2' for a whilebefore it restarts and tries again. (1flash means initialising, 2 flashesmeans establishing itself on thenetwork). Have you definitely gotthe status LED connected to pin8?

    siddiqov (/member/siddiqov/) nathanknz

    Thank you for your consistentreplies. I just Noticed when i restartthe teleduino, the status LED flashonce and then immediately it flashtwo times (Flashes). Does it means itinitialized and started network butcouldn't connect to the server. I willappreciate your tips in this regards. Iwill appreciate your feed back.

    1-40 of65

    Next (http://www.instructables.com/id/Arduino-Control-via-a-Web-Service-with-Teleduino/?&sort=ACTIVE&limit=40&offset=40#DISCUSS)

    Arduino Control via a Web Service with Teleduino http://www.instructables.com/id/Arduino-Control-via-a-Web-Service-wi...

    17 of 18 9/20/2014 5:38 PMPrint to PDF without this message by purchasing novaPDF (http://www.novapdf.com/)

  • Make Comment

    About UsWho We Are (/about/)Advertise (/advertise/)Contact (/about/contact.jsp)Jobs (/community/Positions-available-at-Instructables/)Help (/id/how-to-write-a-great-instructable/)

    Find UsFacebook (http://www.facebook.com/instructables)

    Youtube (http://www.youtube.com/user/instructablestv)

    Twitter (http://www.twitter.com/instructables)

    Pinterest (http://www.pinterest.com/instructables)

    Google+ (https://plus.google.com/+instructables)

    Tumblr (http://instructables.tumblr.com)

    ResourcesFor Teachers (/teachers/)Artists in Residence (/group/air/)Gift Pro Account (/account/give?sourcea=footer)Forums (/community/)Answers (/tag/type-question/?sort=RECENT)Sitemap (/sitemap/)

    Go Pro Today (/account/gopro?sourcea=footer)

    We're Hiring! (/community/Positions-available-at-Instructables/)

    MobileDownload our new apps for iOS,Android and Windows 8!

    Android (https://play.google.com/store/apps/details?id=com.adsk.instructables)

    iOS (https://itunes.apple.com/app/instructables/id586765571)

    Windows(http://apps.microsoft.com

    /windows/en-us/app/7afc8194-c771-441a-

    9590-54250d6a8300)

    Terms of Service (http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=21959721) |Privacy Statement (http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=21292079) |Legal Notices & Trademarks (http://usa.autodesk.com/legal-notices-trademarks/) | Mobile Site (http://m.instructables.com)

    (http://usa.autodesk.com/adsk/servlet/pc/index?id=20781545&siteID=123112)

    Join!

    2014 Autodesk, Inc.

    English

    Arduino Control via a Web Service with Teleduino http://www.instructables.com/id/Arduino-Control-via-a-Web-Service-wi...

    18 of 18 9/20/2014 5:38 PMPrint to PDF without this message by purchasing novaPDF (http://www.novapdf.com/)

  • TeleduinoArduino Internet / Web Control

    Introduction

    Request Key

    Tools

    Documentation

    Downloads

    Terms and Conditions

    Sponsors

    Contact

    Request KeyA key is required to uniquely identify your Teleduino device.

    Keys are generated and emailed to you within a few minutes.

    Your privacy is protected, and your email address is not passed on to third parties.

    Please fill in the below form to request a key. If you require multiple keys for multiple devices, you can completethe form multiple times using the same email address.

    First Name:

    Last Name:

    Email Address:

    Are you human? (type "yes"):

    I accept the Teleduino Terms and Conditions

    Arduino Internet / Web Control with Teleduino https://www.teleduino.org/tools/request-key

    1 of 1 9/20/2014 5:39 PMPrint to PDF without this message by purchasing novaPDF (http://www.novapdf.com/)