Shop OBEX P1 Docs P2 Docs Learn Events
Website to microcontroller — Parallax Forums

Website to microcontroller

lboucherlboucher Posts: 139
edited 2010-07-05 22:24 in General Discussion
Hi All

So I have a website.
Now i want to send data from website to my home computer, and ultimately to a microcontroller.
No real project yet, just want to learn how to do this.
Currently using wordpress for the website.

So anybody know a good tutorial about how to send tcp and or udp data from a website to a home computer?

Thanks
Lucas

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My Animated Christmas Light Show

www.pachristmas.com

Comments

  • bill190bill190 Posts: 769
    edited 2010-06-03 02:22
    Some websites are hosted on·UNIX systems and they give you access to the Perl programming language. Like Pair...

    http://www.pair.com/services/web_hosting/

    If you have a UNIX server and they allow you to create Perl scripts, then following is a search for Perl tcp...

    http://www.altavista.com/web/results?itag=ody&q=perl+tcp&kgs=1&kls=0

    Then so far as data, the above web servers·also have mysql which is a database.·Web scripts for that (cgi) can also be written in Perl.

    As to writing the sql scripts for mysql, you can "cheat" with Microsoft Access (open office?) and create a query, then switch to "sql view" and it will have written the sql for you! (One less thing to learn). You can also use MS Access as a "front end" via ODBC to connect to the website database. I don't know if the open office db has this capability or not?

    All the above·takes a *lot* of reading/learning....
  • lboucherlboucher Posts: 139
    edited 2010-06-03 03:58
    Thanks for the info, i thought i might be lead to perl.

    I have worked around/with perl before, but never actually tried to write something from scratch with it.

    I might go that route, but in the meantime i found an article on Microsoft Visual Web Developer.

    Since i already know a fair amount of C#, this is looking rather enticing.

    Anybody have any thoughts/comments, if not i will report back my findings.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Animated Christmas Light Show

    www.pachristmas.com
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2010-06-03 11:11
    What micro are you using for the project?

    Parallax and I are working on a Propeller powered ethernet device. The product is a couple months out from being ready. This weekend I hope to return to working on drviers for the project.

    Anyway, with something an like ethernet port on your micro you might be able to skip the home computer. Using a fixed home IP or dynamic DNS your webserver could send the data directly to the mirco. Another option would be to have the micro ping the web server every so often and pick up the data it needs, this may alleviate having to code something on your web server to send data to your home.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter, E.I.
    www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, 3.0" 16:9 LCD Composite video display, eProto for SunSPOT, PropNET, PolkaDOT-51
    www.tdswieter.com
  • lboucherlboucher Posts: 139
    edited 2010-06-04 22:22
    Thanks for the responce.
    My current idea actually necesitates* the computer

    And due to the Real Time nature of my idea, that just formed yesterday, i think i need the web server to contact the micro in real time.

    Anyways, the cloud of ideas is still conjelling*, will post the final project when done.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Animated Christmas Light Show

    www.pachristmas.com
  • NWCCTVNWCCTV Posts: 3,629
    edited 2010-06-27 07:31
    What about using the PINK on your end and FTP from the website back to the PINK then to your computer?
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2010-06-27 08:51
    IMHO Email to the Pink might be even better if possible and NOT require using software like Perl and PHP. FTP transfers opens your computer to being hacked in a lot of ways unless you really comprehend the protocol.

    Be advised, there always are delays involve over the internet. Real time control in the US from here in Taiwan is not very realistic.(There was a guy with a robotic tank control on the internet and the delays were too much for me to properly operated the tank.) There are also websites that allow you to test for delays between your ISPN and other locations throughout the globe. (Ubuntu Linux will also run tests to and from specific sites and much more helpful about this than M$ Windows - the utilities software is all free.) From Taiwan, my slowest communications are with Europe and they are extremely slow. But anything outside of Taiwan is a mere fraction of the service that I am supposedly paying for (maybe 1m tops when I pay for 8m of bandwidth).

    In sum, even with the right hardware, you still need to have the right service in place to implement these kinds of applications. And if your application can be designed to be tolerant of delays, all the better.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Ain't gadetry a wonderful thing?

    aka G. Herzog [noparse][[/noparse] 黃鶴 ] in Taiwan

    Post Edited (Loopy Byteloose) : 6/27/2010 9:05:47 AM GMT
  • TimCTimC Posts: 77
    edited 2010-07-05 22:24
    Lucas,
    I am not sure if I am on target here but think about what we are doing when we are reading this forum topic.
    We are simply doing a TCP/IP GET to forums.parallax.com/forums on port 80 which you can actually do using a telnet program. So if you want to send TCP/IP packets to your computer you can do a GET on a web page of data. To set this up you would need the formatted page available on your host and a small client task written in Java or pearl or anything else which does the HTTP GET and stores the data somewhere.

    You can also choose to have the host server make the connection to your computer maybe using a pearl script as others have mentioned. The Mail protocol is a good idea also because you do not have to have a hole in your firewall to receive the TCP/IP connection.

    Avoid adding additional computers and complexity as much as possible. Remote websites love to stop working.


    The following is a small snippet of code that grabs a weather page from NOAA written in Java that ran long ago on a TINI chip.

    Good luck
    Tim C



          try {
             //URL u = new URL("http://www.erh.noaa.gov/er/box/fcsts/BOSZFPBOX.html");
             URL u = new URL("http://www.erh.noaa.gov/er/box/fcsts/" + urlLocation + ".html");
             InputStream in = u.openConnection().getInputStream();
             byte[noparse][[/noparse]] content = new byte[noparse][[/noparse]512];
             int count = 0;
             do {
                s = new String(content);      // convert byte array to string
                bufwork.append(s);            // convert string to StringBuffer
                count = in.read(content);
                //System.out.println("Origional Text Length=" +  count);
                //System.out.write(content, 0, count);
             } while (count != -1);
          } catch (Exception e) {
             System.out.println(e.getMessage());
             e.printStackTrace();
          }
    
    
Sign In or Register to comment.