This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Getting started with SensESP
#1
I'm having some issues getting started with SensESP.

My setup is: 
Pi5
OpenPlotter 4

Freenove ESP32 wrover flashed w/Espressif 1.24.0

I'm able to build the SensESP-project-template-main and upload it on the board using VSCode and PIO.

Then I can connect my phone's wifi to the `my-sensesp-project` network but after that the WiFiManager configuration screen does not appear automatically. When I enter the captive ip address 192.168.4.1 in my browser, nothing happens or it times out.

On the terminal I get this log:
Code:
Please build project in debug configuration to get more details about an exception.
See https://docs.platformio.org/page/projectconf/build_configurations.html


--- Terminal on /dev/cu.usbserial-1420 | 115200 8-N-1
--- Available filters and text transformations: colorize, debug, default, direct, esp32_exception_decoder, hexlify, log2file, nocontrol, printable, send_on_enter, time
--- More details at https://bit.ly/pio-monitor-filters
--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H
I (39) filesystem.cpp: Filesystem initialized
D (49) saveable.cpp: Configuration loaded for /system/hostname
D (49) config_item.h: Registering ConfigItemT with path /system/hostname
D (107) networking.cpp: Enabling Networking
D (130) Arduino: Arduino Event: 0 - WIFI_READY
D (783) Arduino: Arduino Event: 2 - STA_START
D (798) Arduino: Arduino Event: 3 - STA_STOP
D (799) Arduino: Arduino Event: 10 - AP_START
I (799) networking.h: WiFi Access Point enabled, SSID: my-sensesp-project
I (802) networking.h: IP address of Device: 192.168.4.1
I (807) networking.cpp: Starting access point my-sensesp-project
D (814) config_item.h: Registering ConfigItemT with path /System/WiFi Settings
D (854) config_item.h: Registering ConfigItemT with path /system/httpserver
I (856) saveable.cpp: Not loading configuration: no config_path specified:
I (857) saveable.cpp: Not loading configuration: no config_path specified:
D (893) config_item.h: Registering ConfigItemT with path /System/Signal K Settings
D (894) base_button.h: Button handler started
I (895) saveable.cpp: Not loading configuration: no config_path specified:
I (901) saveable.cpp: Not loading configuration: no config_path specified:
D (937) config_item.h: Registering ConfigItemT with path /Sensors/Analog Input/Voltage
D (967) config_item.h: Registering ConfigItemT with path /Sensors/Digital Input 2/Value
D (967) main.cpp: Digital input value changed: 1
I (971) http_server.h: HTTP server started
E (972) Arduino: Failed adding service http.tcp.

D (976) signalk_ws_client.cpp: Starting SKWSClient
E (981) Arduino: Failed adding service signalk-sensesp.tcp.

I (981) signalk_ws_client.cpp: Initiating websocket connection with server...
I (993) discovery.cpp: mDNS responder started for hostname 'my-sensesp-project'
D (1400) main.cpp: Analog input value: 0.142000
D (1900) main.cpp: Analog input value: 0.142000
D (2400) main.cpp: Analog input value: 0.142000
D (2900) main.cpp: Analog input value: 0.142000
D (3400) main.cpp: Analog input value: 0.142000
D (3900) main.cpp: Analog input value: 0.142000
W (4091) Arduino: No results found!
E (4091) signalk_ws_client.cpp: No Signal K server found in network when using mDNS service!
D (4091) signalk_ws_client.cpp: Websocket is not connecting to Signal K server because host and port are not defined.
I (4102) signalk_ws_client.cpp: Initiating websocket connection with server...
D (4400) main.cpp: Analog input value: 0.142000
D (4900) main.cpp: Analog input value: 0.142000
D (5400) main.cpp: Analog input value: 0.142000
D (5900) main.cpp: Analog input value: 0.142000
D (6400) main.cpp: Analog input value: 0.142000
D (6900) main.cpp: Analog input value: 0.142000
W (7191) Arduino: No results found!
E (7191) signalk_ws_client.cpp: No Signal K server found in network when using mDNS service!
D (7191) signalk_ws_client.cpp: Websocket is not connecting to Signal K server because host and port are not defined.

And so on.

My Signal K server is running and I'm logged onto it on my browser without issues.

I'm quite new to this and not sure what's happening but I'm looking forward to making it work.
Reply
#2
There's a dedicated sensesp channel on the signalk discord server, the sensesp author is usually close by so maybe that would be a place to ask - https://discord.gg/uuZrwz4dCS
Reply
#3
Thanks PaddyB. I posted there as well.
Reply
#4
For reference, if it can help someone, I finally found a way to make it work.

Previously, when I saw that I couldn't connect to the SensESP UI, I tried to build the project with hardcoded access point like this:


Code:
// Construct the global SensESPApp() object
  SensESPAppBuilder builder;
  sensesp_app = (&builder)
                    // Set a custom hostname for the app.
                    ->set_hostname("my-sensesp-project")
                    // Optionally, hard-code the WiFi and Signal K server
                    // settings. This is normally not needed.
                    //->set_wifi_client("My WiFi SSID", "my_wifi_password")
                    ->set_wifi_access_point("OpenPlotter", "my_signal_k_password")
                    ->set_sk_server("192.168.2.233", 3000)
                    ->get_app();

But I didn't receive the Access request on Signal K (under Security > Access Requests). Today, I realized that it was because I was only adding the Signal K server address and password, not my home Wifi network.

By uncommenting this line:
Code:
set_wifi_client("My WiFi SSID", "my_wifi_password")

And adding my home wifi SSID and pass, I did get the access request in Signal K.

I guess I didn't understand the need to be connected to my own wifi first in order to accept the ESP32 as an access point in Signal K. It makes total sense but I totally missed it at first.

To recap, if you're trying to connect SensESP with Signal K by hardcoding, in main.cpp, you need to fill:

  1. The Wifi client (your home wifi): set_wifi_client
  2. The Wifi access point (the OpenPlotter hotspot): set_wifi_access_point
  3. The Signal K server (IP and Port): set_sk_server
Reply
#5
I realize that this is older thread, but I am not sure this is the most correct way. On the boat, you are not nescessarily going to have internet. Were you running the raspi headless or with a display?

https://signalk.org/SensESP/pages/troubleshooting/

" while SensESP devices will communicate with the server using the wifi SSID created by OpenPlotter. But if the Pi is connected to your network solely via wifi, that’s where the problem lies, and you’ll have to follow the steps below.... "

and some really convoluted hackery.

What is really confusing to me is that the Troubleshooting guide also states a headless machine "the only way to get to Signal K (so that you can, for example, authorize a SensESP security request) is by connecting to a network with internet connectivity".

This seems to go against the ethos of OpenMarine to be free of dependances; you are at Sea, something happens and with your best McGuvering skills, reconfigure or modify existing modules and sensors only to get stymied by needing an internet connection?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)