ZeroConf/Bonjour Library

Status
Not open for further replies.
Well, when I compile the test code with 1.18rc2, I can't get an IP address using DHCP...
Code:
EthernetBonjour - Registering a service
Reading MAC from hardware...
Configuring IP
04:E9:E5:00:41:3B
Ethernet,begin() failed - Resetting TeensyNet
EthernetBonjour - Registering a service
Reading MAC from hardware...
Configuring IP
04:E9:E5:00:41:3B

But when I compile with 1.18rc1, it works...
Code:
EthernetBonjour - Registering a service
Reading MAC from hardware...
Configuring IP
04:E9:E5:00:41:3B
Ethernet,begin() success
My IP address: 192.168.1.23
Bounjour Service started
avahi-discovery-1-18rc1.png
 
Is that using my GitHub code or with the file I had linked here in this thread ?
The GitHub code was tested with your sketch with slight modifications to make it work in the Arduino Eclipse IDE and worked fine with the Teensyduino 1.18RC2.
I am actually not sure when the SPIFIFO code was added, as I never installed 18.1
 
Hmmm....that is odd. Maybe I accidentally loaded done RC 18.1 ?

Will check tomorrow. At least there is partial success:cool:
 
I downloaded a virgin copy of Arduino 1.0.5 and teensyduino 1.18RC2. I t looks like the Ethernet library I am using is not from Teensyduino 1.18RC.2. Will be fixed hopefully over the weekend.
I will also look a little closer at making this hardware independent and replacing all the calls to the W5100.h/.cpp with "normal" UDP calls.
 
Got the code working in my project, am in the process of adding new devices to see if it all work as needed. Thanks for you work on this.
 
Thanks!
I must say that I am somewhat surprised that this seems to be of so little interest, particularly with such an overwhelming interest of connecting " things" to the Internet or to network "things". Of course my comment only reflects the hobbyist/maker scene revolving around the popular microcontrollers and mini computers.

Perhaps the reason for this is that the vast majority of projects never leaves the state of a prototype for personal use of a particular maker and the question of how does one make a device useable for general public users remains unanswered in that realm.
 
Thanks!
I must say that I am somewhat surprised that this seems to be of so little interest, particularly with such an overwhelming interest of connecting " things" to the Internet or to network "things". Of course my comment only reflects the hobbyist/maker scene revolving around the popular microcontrollers and mini computers.

Perhaps the reason for this is that the vast majority of projects never leaves the state of a prototype for personal use of a particular maker and the question of how does one make a device useable for general public users remains unanswered in that realm.

Headroom, never fear, there is indeed a lot of interest, but, as in my case, very little knowledge to support the cause. It has been a very steep learning curve just to get UDP packets streaming to the Teensy 3 to update octows2811 through the router using a known (static IP) address hard coded for cc3000. All I can offer is testing.
 
You mentioned the the CC3000. This is one of the reasons I am slowly trying to get my head around to making this library hardware independent, or more precisely just use the EthernetUdp library instead of all the SPI function calls directly to the W5100 or W5200 hardware. I actually have a CC3000 on a breakout board on order from Adafruit, so I can start playing around with it.
On the library is UDP calls only it should be much easier to adapt to other hardware.
 
Not meaning to hijack the thread but...

When I use the bonjour library on a wired connection, everything works fine. I use avahi-discover and avahi-browse to detect and include new TeensyNet devices on my network.

I'm also trying to use the TeensyNet in a wireless configuration. To do that, I'm trying to use a TL-WR703N (I get mine from china), with either DD-WRT or OpenWRT operating as a relay or pseudobridge.

I can see the wireless TeensyNet using arp-scan, and can ping and interrogate it, but avahi-discover or avahi-browse doesn't find it.

Any suggestions or clues??
 
Have you tried if it works with the stock firmware on the TL-WR703N ?

I am using the same pocket router with the sock firmware and that works fine. If you're wondering how I got that to work I can only say hat Google translate helped to translate the Chinese menu structure into something understandable :)
 
Have you tried if it works with the stock firmware on the TL-WR703N ?

I am using the same pocket router with the sock firmware and that works fine. If you're wondering how I got that to work I can only say hat Google translate helped to translate the Chinese menu structure into something understandable :)

Thanks for that info!! I've discovered that you can flash the TL-WR703N with TL-MR3020 English-Language Firmware from here or here, and setup from there.

Worked like a champ!!
 
Does that refer to re-flashing the router or to the Bonjour part or both ?

If it refers to both then it would be interesting what does prevents Bonjour from working on the OpenWRT and DD-WRT firmware.

Both, could not get the bonjour working with either OpenWRT 0r DD-WRT, and once I got the TL-Link software working, I stopped trying to figure it out.

Maybe I'll revisit it some other time.
 
I've been reading some and it seems that neither OpenWRT or DD-WRT include Zeroconf out of the box. One would have to install either and avahi or mdnsresponder package on the router.
 
I've been reading some and it seems that neither OpenWRT or DD-WRT include Zeroconf out of the box. One would have to install either and avahi or mdnsresponder package on the router.

At least with OpenWRT, there wasn't sufficient flash memory available to do that, never tried it with DD-WRT.
 
OK, I figured out the problem I was having with 18rc2. It was my bad :eek:

I forgot to reconfigure a couple of library files to meet my needs.
Once I fixed that, everything seems to be working fine.

Adding notes in my .ino file to remind me from now on... :p
 
Glad you've got it working.

Meanwhile Iv'e been digging through the code of the library and comparing it with code already present in the Ethernet library e.g. with socket.cpp and EthernetUDP.cpp etc.
It looks like a good bit of code is replicated in the Bonjour library and I started wondering why the original author did this. But I remembered that he wrote the Bonjour library was initially written for Arduino 0018 and the updated to support 0019 and later. A lot of the functionality now included in the Ethernet library did not exist then but was needed for the Bonjour library. I just loaded down Arduino 0022 just to see what the Ethernet library looked like at that time.

I believe the author used code that was already existing in some form and meant for inclusion in future Ethernet libraries and that provided the functionality needed for the Bonjour library. Interesting!

It looks like there can be a good bit of cleanup done by using code that is already present in different files of the Ethernet library. This will take a while, however ;-)
 
So far I have eliminated the need for the EthernetCompat.h and EthernetCompat.cpp and have replaced all mDNS W5200 calls with existing calls from EthernetUDP. Also fixed one little bug. There is also no need anymore for the #W5200 define. The chip auto detection of the ethernet library functions as intended. Next I'll work on the DNS-SD part and hope to get it to a functioning state.
 
I stated earlier in the thread that the mDNS part works but the DNS-SD ( Service Discovery) part would not.

So I've tinkered around with Wireshark today to get to the ground of that!

It looks like the mDNS queries for the Service Discovery are being sent correctly and responses to the queries are visible in Wireshark but came after the Arduino software times out (10 sec). I may have to play around with the timing a bit more and at the same time figure out why this is so slow on my small home network.

Interestingly enough most of my devices are Apple brand with the exception of the TP-Link TL WR703n and 702 pocket routers in my Bonjour enabled DIY devices.
 
Last edited:
So far I have eliminated the need for the EthernetCompat.h and EthernetCompat.cpp and have replaced all mDNS W5200 calls with existing calls from EthernetUDP. Also fixed one little bug. There is also no need anymore for the #W5200 define. The chip auto detection of the ethernet library functions as intended. Next I'll work on the DNS-SD part and hope to get it to a functioning state.

Have you made the new code available yet?
 
Have you made the new code available yet?

No I have not. It's not quite ready yet, even if you are just interested in registering a service. There are two main routines in the library. One that sends mDNS messages and on that receives mDNS messages. The first one used 20-30 W5200.write() calls. All of those have been replaced with proper calls from the EthernetUDP library.
The second routine includes a slightly higher number of W5200.read() calls and I have not yet replaced any of those.
Some of them can be replaced easily, others are a little more complicated.
Some of the second routine is required for service registry as well, so before I have that cleaned up it's not ready to be posted. I hope to be able to post an intermediate version within the next 2 weeks.

In order to get a more in-depth understanding I am currently reading
"Zero Configuration Networking: The Definitive Guide"
 
No rush, the current code works for my purposes as-is. I'm in the process of publishing my web pages, and if the libraries change, I like to test them beforehand.
 
May/may-not be relevant..
At my home, when I tried to run the iPAD printing (no special iPad software), it worked fine from iPad WiFi to WiFi access point connected to MoCA (IP over TV Coax) to ethernet switch to NAS. On the NAS is software that converts Apple-speak from the iPad into open standards formats from the NAS to the Epson printer/scanner - which does not have integrated Apple compatibility.

But, when the iPad talks via WiFi to a WiFi BRIDGE product, rather than a WiFi Access Point (AP), the iPad says: No printer found. Odd, because an AP is a form of bridge.

( wasting a lot of paper, because the iPad lacks the choice of print only selected pages).
 
Status
Not open for further replies.
Back
Top