Shop OBEX P1 Docs P2 Docs Learn Events
UDP messages with the Pink to a Server — Parallax Forums

UDP messages with the Pink to a Server

Brian CarpenterBrian Carpenter Posts: 728
edited 2007-01-10 23:36 in General Discussion
Can anybody point me in the right direction/· I want to send a string via udp protocol from my pinkto a server that will have PHP and PERL and MySQL.· i want to be able to reciece the string and parse it into the database.· Any ideas?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


It's Only A Stupid Question If You Have Not Googled It First!!

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-01-10 22:31
    I'd start at StartLogic, your hosting service. You need to find out if you can run a daemon that listens for UDP packets (probably not). Then, you'll probably have to write one. Perl might be good for this. You'll also need to consider security issues: e.g. if you can send UDP packets to the server, how do you prevent others from doing the same? Some kind of authentication technique will be necessary. That may be as simple as a whitelist of IP addresses (although these can be spoofed).

    A better approach might be to set up an email account just for the PINKs to send mail to. Then write a Perl program that runs as a cron job to check the account's POP server on a regular basis. (Your hosting service is more likely to allow cron jobs than to allow custom daemons. If they don't, switch to FutureQuest.) Then, have the PINK modules send email to that account. When a message arrives, the cron program can read it, parse it, and stuff the data into a file that your CGI or PHP scripts have access to.

    -Phil
  • Brian CarpenterBrian Carpenter Posts: 728
    edited 2007-01-10 23:36
    Thank you Phil. The sencond option that you suggest is the way that i currently am using the system at work. ( i need to write that one up for parallax. I have 60 pinks in employment. I use a program called email to DB that puts the info into the database.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    It's Only A Stupid Question If You Have Not Googled It First!!
Sign In or Register to comment.