-
Notifications
You must be signed in to change notification settings - Fork 95
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
Ethernet Shield Compatibility? #127
Comments
@faultfactory, this library heavily relies on HTTPClient and WifiClient classes from ESP SDKs. You would have to get sth similar for arduino devices or update all related parts for different HTTPClient. This is, in fact, sth which makes implementation for WiFiNINA compatible devices difficult. |
Understood. I'll explore the topic a bit more. Would be great to add a fork or a pre processor directive to make this |
I've dug into this a bit and I believe I understand the problem more. There's a base arduino library called HttpClient, separate from the ESP ones and it looks to have similar functionality with slightly different names. For example, addHeader() in the ESP vs sendHeader() in the base arduino library. The same exists for connectionReuse. I am going to attempt a fork to see if this works but could use your input to help limit my focus to where it matters. Assuming for the moment I am only interested in writing to a (local network, not cloud) database, and not sending queries, it looks like the only files i would need to modify are InfluxDBClient.h and InfluxDBClient.cpp. The other files appear to be wrappers and abstractions. Am I missing anything? |
This is an extremely hard nut to crack as there are so many library functions in the ESP packages that need to be recreated and generally the existing library relies on them so heavily, that the existing debug functionality is null and void. @tobiasschuerg @vlastahajek Might you know of a minimum viable product sketch that is able to write to InfluxDB from an ethernet shield? I have tried numerous combinations of influx ENV variable settings and sample sketches. Nothing appears to work, however i know the system is operable because i have code running on a raspberry pi that easily writes to the database. |
@faultfactory, basicaly, for writing data to local server you just need to send a single HTTP POST request. See https://docs.influxdata.com/influxdb/v1.8/guides/write_data/ for more details You will probably find many examples how to construct HTTP POST request without a HTTP client library for Ethernet Shield. |
@vlastahajek If I can wrap up something that looks library-like, I'll see if it fits into the context of the existing api. Thanks for fielding the questions. |
I'm still having trouble with the ethernet shield in writing to the influxdb client with HTTP post alone, is it because Influx2.0 needs to have the bucket, enviroment, and token somewhere to be referenced in order to write data? Sorry for the question, but I'm trying to figure out if it would still be possible to take the existing influxdb library or if it was determined HTTP post was the way to go for the ethernet shield |
I ended up having to go with the HTTP post directly, but I am using Influx 1.8 as the 2.0 docker wasn't available when i was working on this
I'm logging hvac status information. One of my lines is the following.
I'll run
and it sends the data to influx |
@bananograms, try HTTP post with |
Hi guys, Right now i have working code to write to my DB some sensor measurements but it only works with WiFI (with ethernet is gets stuck on the timeSync)... EDIT#1 |
@aldomeza-dev, what is the ethernet chip on your shield? |
any libraries used by WiFi class works in esp32 if you use LAN8720 so no need to modify anything on this library, incase of w5500 its more complicated but I managed to make it work just like lan8720, I extracted the example from esp32 sdk and build my own header file now its working perfectly I can freely switch to wifi and lan without changes to every libraries I used, as for esp8266 use the w5500lwip library, hope this helps |
@rjjrbatarao, exactly. A driver for LAN8720 is part of the ESP-IDF and uses the lwIP layer. So it can be transparently used by WiFi Client. There is an example for getting network information part of the ESP32 examples Great job making it work with W5500. Do you have a driver for it available on GitHub? |
@rjjrbatarao yes please integrate this to the library, that'd save us all so much pain. |
It's the WIZ5500, to be specific this one Adafruit Ethernet FeatherWing |
Is there anything in this library that would not work with an arduino ethernet shield vs one of the wifi modules? If i wanted to modify this code to work in that manner are there some pointers you can provide?
The text was updated successfully, but these errors were encountered: