Demo app showing Web browser controlling Netduino via Raspberry Pi
This is a slightly out of focus demo of a cut down version of my robot buggy software.
(This is take 2, take 1 had a cat walking over the table.)
I have stripped down the buggy code to bare bones so I can share it as a starting point for a project (although there are still a lot of bones).
On the Netduino is a multi-threaded app that reports button press and release events to the Raspberry Pi via UDP. It also accepts UDP commands to turn the LED on or off.
The Pi has been setup to run a Python script on start up. It accepts the UDP status mesages from the Netduino and stores the current state of the button.
It also accepts TCP connections that can request the current status and/or request the LED on/off messages to be sent to the Netduino. The Python reports the current status as a simple html formatted text string that includes the state and the filename of a graphic to display. (There are actually two items that are displayed, the button state, and the state of the last request LED to the Netduino.)
The web page is served from a web server on the Pi. The web pages use PHP to make the TCP connections to the Python. PHP is a language that runs on the server - not in the user's browser. I wanted to avoid running stuff on the user's browser so that there are less requirements. In fact the Web pages will run on my 7 year old Palm T|X.
With each TCP connection to the Python, the PHP sends a simple text string that indicates what is wanted. The Python then acts upon it and returns the status text back to the PHP via the TCP connetion, which is then closed.
The main web page sends a request for status and displays it. It has a timer (html) to make it update (reload) every second.
The buttons cause a new web page to be opened to handle the button press. This web page just has some PHP that sends a request to the Python, and then imediately returns to the main page.
There is hardly any HTML or PHP to write.
There are no libraries of Python to install, just normal socket code and threads to handle messages.
The same with the Netduino, it runs some threads that send and receive UDP messages over Ethernet. The threads mean the main program can carry on running whilst the Ethernet stuff goes on in the background.
It going to take me a while to package up all the code and instructions, they should appear on the Netduino Forums when I do:
http://forums.netduino.com/index.php?/topic/7704-dfrobot-buggy/
Paul
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Demo app showing Web browser controlling Netduino via Raspberry Pi», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.