Access Linux shares from ESP32

Cool Javelin
Posts: 12
Joined: Wed Oct 20, 2021 3:58 am

Access Linux shares from ESP32

Postby Cool Javelin » Sun Jun 19, 2022 12:20 am

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.

ESP_Sprite
Posts: 9745
Joined: Thu Nov 26, 2015 4:08 am

Re: Access Linux shares from ESP32

Postby ESP_Sprite » Sun Jun 19, 2022 1:31 am

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.

Craige Hales
Posts: 94
Joined: Tue Sep 07, 2021 12:07 pm

Re: Access Linux shares from ESP32

Postby Craige Hales » Sun Jun 19, 2022 7:21 pm

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

chegewara
Posts: 2364
Joined: Wed Jun 14, 2017 9:00 pm

Re: Access Linux shares from ESP32

Postby chegewara » Mon Jun 20, 2022 7:16 pm

How about FTP or curl? I think i also saw tftp library somewhere.

alanesq
Posts: 86
Joined: Thu Dec 14, 2017 8:38 pm

Re: Access Linux shares from ESP32

Postby alanesq » Mon Jun 20, 2022 7:59 pm

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/

vanBassum
Posts: 68
Joined: Sun Jan 17, 2021 11:59 am

Re: Access Linux shares from ESP32

Postby vanBassum » Tue Jun 21, 2022 11:56 am

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.

Who is online

Users browsing this forum: No registered users and 105 guests