I am building some personal IoT stuff, and I'd like to build a log file on one of my personal Linux servers.
I have the ESP32 accessing the WiFi, I have build a web page in the ESP where I can change the parameters of my IoT thing, and I am using the OTA library that works well.
I'd like to insert debugging information in the various loops, but I am hoping to not have a USB cable attached so using the Arduino serial monitor is out.
What is the best library I can use to open a file on a Samba share, write to it, then close the file?
Thanks for your help.
Mark.
Access Linux shares from ESP32
-
- Posts: 9709
- Joined: Thu Nov 26, 2015 4:08 am
Re: Access Linux shares from ESP32
If you are running Linux anyway, it's probably better to use something like remote UDP syslog logging (which e.g. rsyslogd and other system loggers can pick up) as it's a lot more lightweight than Samba or NFS. The syslog protocol is pretty trivial if you want to write something yourself, but there are also libraries out there which can do it.
-
- Posts: 94
- Joined: Tue Sep 07, 2021 12:07 pm
Re: Access Linux shares from ESP32
I think you might be going down a better path, but a long time ago I used an Apache+PHP web page on a low-end VPS to accept POSTs for logging time lapse JPGs from a raspberry pi. Use https and Basic Auth to keep it reasonably secure. The advantage might be a smaller footprint on the esp32, if you need the https support anyway.
Craige
Re: Access Linux shares from ESP32
How about FTP or curl? I think i also saw tftp library somewhere.
Re: Access Linux shares from ESP32
An interesting way to easily transfer files which I have used and may be of interest is to install Apache on your linux computer then us a php script.
see: https://RandomNerdTutorials.com/esp32-c ... to-server/
see: https://RandomNerdTutorials.com/esp32-c ... to-server/
Re: Access Linux shares from ESP32
I'd go with ESP_Sprite's syslog solution. That beeing said, I you really want to make something yourself, id go with a webapi.
https://docs.microsoft.com/en-us/aspnet ... ual-studio
You can run this cross platform. I'd go with a docker hosting.
https://docs.microsoft.com/en-us/aspnet ... ual-studio
You can run this cross platform. I'd go with a docker hosting.
Who is online
Users browsing this forum: Bing [Bot] and 95 guests