Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using syslog.logf crashed the Arduino #19

Open
Cyb0rg42 opened this issue Oct 7, 2018 · 2 comments
Open

Using syslog.logf crashed the Arduino #19

Cyb0rg42 opened this issue Oct 7, 2018 · 2 comments

Comments

@Cyb0rg42
Copy link

Cyb0rg42 commented Oct 7, 2018

I'am using the libraty on a Arduino Mega with an Ethernet Shield. When I use the syslog.logf function the Arduino stops working. Any idea what I' am doing wrong?

Sketch:

RemotePowerSwitch.txt

Thanks,
Karl

@saspol
Copy link

saspol commented Apr 2, 2019

Have same problem with Mega and W5100 shield.
First usage syslog.log() crashing system.

@brianrho
Copy link

Likely caused because the library doesn't open the Ethernet socket first before writing log strings to it. This should be done with this->_client->begin(someRandomLocalPort) or in your sketch setup(), can also be done with udpClient.begin(someRandomLocalPort).

At first, while trying to port this library, I spent a while searching to see if this was already done automatically somewhere down the stack, but I found nothing. Then I found this issue which confirms the present Ethernet example won't work, probably wasn't a big deal before since most people use ESP8266/32 WiFi, whose UDP library doesn't seem to directly operate on sockets the same way as the W5x00 library, instead dynamically creating a new UDP context as needed for each datagram.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants