Dear, dear all,
I'm trying to learn everything myself but i cant figure out the best way to do the following.
I had/have..:
A Perl script on a raspberry pi that checks a website on the INTERNET every 3 seconds for updates...
On the website is a number, say 1 or 2..
The Perl script does something depending on the 1 or the 2.
Now i want to reduce traffic so i would like this:
I still have 1 PHP webpage, now with 1 button.
If i push this button a 1 magically turns into a 2 or the other way around.
when this button is pressed a want to send a "trigger" to my RPi so my perl script can take over..
In this way my Perl script does not have to check the website like 26400 times a day and it still reacts fast.
I was thinking about a tcp packet?? I can when i start my Perl script, send my IP-adres to the website and store it in a DB to use later. If this could be the best option i found some examples but they are all different and the only thing 1 need is sending 1 digit or letter.. just a trigger.
Now my knowledge of php is 'ok', my Perl experience is from the last week and my TCP/IP knowledge is almost 0.
And my english maybe could be better but i'm from the Netherlands, so sorry for that :D
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.