Go Down

Topic: BridgeUDP library for Yun (Read 389 times) previous topic - next topic


Bought a Yun for some project, to replace some other boards we have out in the field.

The older boards broadcast an UDP message with status and I'm now trying to find out how to bridge an UDP signal on the Yun. 
Already searched on the forums and they have a few nice examples, when I discovered there is a BridgeUdp delivered standard with the new(er) arduino IDEs.

So I'm now in the process of trying that one out, without success yet. My code will compile and run, but when the UDP sigment is called it slows down to a crawl and won't actually send anything...

Main question: Did someone had some successes with this library yet, at all?
I'm going through the arduino and openWRT to find all if any clues but it looks like it is unfinished.
Evil Base of Operations: Holland


By the grace of the Arduino gods I have made small successes that I would like to share with the world!

I have found out that the latest Yun firmware does not contain the latest files from https://github.com/arduino/YunBridge
In this github I found that the file bridge.py contains an extra import, namely 
82 import sockets_udp
83 sockets_udp.init(cp)

I manually added these to the version on the Yun and added sockets_udp.py to the folder.
After this, the code began to work!
My code for sending a few bytes right now:

Code: [Select]
#include <Process.h>
#include <BridgeUdp.h>

BridgeUDP Udp;

void setup() {
  Bridge.begin();        // initialize Bridge

void loop() {
  IPAddress IP(10, 10, 1, 86);
  uint8_t data[] = {0xDE, 0xAD, 0xBE, 0xEF};
  Udp.beginPacket(IP, 50001);
  Udp.write(data, sizeof(data));

My PC has IP and Wireshark confirms that every second 2 packages arrive with the UDP protocol.

I will now focus on receiving, but my expectation is that this won't take long as it seems the same as "normal" ethernet compatible boards.
Broadcast doesn't work eighter yet, but thats on my to-do list after the receiving.

Evil Base of Operations: Holland

Go Up