Page 1 of 1
Access Linux shares from ESP32
Posted: Sun Jun 19, 2022 12:20 am
by Cool Javelin
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.
Re: Access Linux shares from ESP32
Posted: Sun Jun 19, 2022 1:31 am
by ESP_Sprite
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.
Re: Access Linux shares from ESP32
Posted: Sun Jun 19, 2022 7:21 pm
by Craige Hales
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.
Re: Access Linux shares from ESP32
Posted: Mon Jun 20, 2022 7:16 pm
by chegewara
How about FTP or curl? I think i also saw tftp library somewhere.
Re: Access Linux shares from ESP32
Posted: Mon Jun 20, 2022 7:59 pm
by alanesq
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/
Re: Access Linux shares from ESP32
Posted: Tue Jun 21, 2022 11:56 am
by vanBassum
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.