Esp32 connection to SignalK #96
Replies: 7 comments 8 replies
-
https://signalk.org/SensESP/ should provide answers to your use case. |
Beta Was this translation helpful? Give feedback.
-
Ok for instance this file onewire_temperature.h - where do i define the pin that the data wire of the ds18b20's are connected? Theres comments to set @param pin - but there is no infor related to where do I enter this and in what format? I have the data wire on pin 25 of the esp32 #ifndef SENSESP_SENSORS_ONEWIRE_H #include #include "OneWireNg.h" #include "sensesp/sensors/sensor.h" namespace sensesp { typedef std::array<uint8_t, 8> OWDevAddr; /**
/**
private: } // namespace sensesp #endif |
Beta Was this translation helpful? Give feedback.
-
then you have the onewire_temperature.cpp It also mentions pins ? which file do i define the pins in and how ? #include #include "onewire_temperature.h" #include "OneWireNg_CurrentPlatform.h" #define DEVICE_DISCONNECTED_C -127 namespace sensesp { const OWDevAddr null_ow_addr = {0, 0, 0, 0, 0, 0, 0, 0}; void owda_to_string(char* str, const OWDevAddr& addr) { bool string_to_owda(OWDevAddr* addr, const char* str) { DallasTemperatureSensors::DallasTemperatureSensors(int pin, String config_path) #if (CONFIG_MAX_SRCH_FILTERS > 0) error "OneWireNg config: CONFIG_MAX_SRCH_FILTERS not defined"#endif // in the process of 1-wire bus scan OWDevAddr owda; for (const auto& addr: *onewire_) { bool DallasTemperatureSensors::register_address(const OWDevAddr& addr) { registered_addresses_.insert(addr); bool DallasTemperatureSensors::get_next_address(OWDevAddr* addr) { OneWireTemperature::OneWireTemperature(DallasTemperatureSensors* dts, void OneWireTemperature::start() { void OneWireTemperature::update() { // temp converstion can take up to 750 ms, so wait before reading void OneWireTemperature::read_value() { if (dts_->get_dallas_driver().readScratchpad( // we're on purpose ignoring the "conversion not ready" value (+85°C) void OneWireTemperature::get_configuration(JsonObject& root) { static const char SCHEMA[] PROGMEM = R"({ String OneWireTemperature::get_config_schema() { return FPSTR(SCHEMA); } bool OneWireTemperature::set_configuration(const JsonObject& config) { } // namespace sensesp |
Beta Was this translation helpful? Give feedback.
-
This is a great example actually of how the documentation is missing detail. - https://github.com/SensESP/OneWire/raw/main/examples/onewire_temperature/images/define_sensor_pin.png this detail here is formatted different than in the actual example code How do i set the pin in the code below from the template, here using the above instructions, they are completely different ? Is it just the number 25 after the , i.e pin,25 or is it pin, (25) DallasTemperatureSensors::DallasTemperatureSensors(int pin, String config_path) |
Beta Was this translation helpful? Give feedback.
-
Are you still working on this? While not a developer, I have some experience with ESP32's. I would approach this incrementally to understand all the functions. I would:
|
Beta Was this translation helpful? Give feedback.
-
Hi Guys, Have sort of hit a wall , I changed over to Jasons code - https://github.com/Techstyleuk/sensesp-engine_monitor I have senseesp working, it connects to my raspi signalk server, however, it does not detect the dallas sensors.. I've been working on rebuilding the starter motor solenoid on my boat and sorting some cooling issues on my 4hp outboard so have got a bit sidetracked. I get the below when the esp32 starts up I do have the 38pin esp wroom32 and a breakout board with it, im 99% sure I have the right gpio pin. |
Beta Was this translation helpful? Give feedback.
-
Just as a note, I've implemented signalk support from scratch in my new project: It should be good to have multiple implementations of signalk interfaces for esp32 exercising different code paths and different underlying libraries hopefully this strengthens support! |
Beta Was this translation helpful? Give feedback.
-
Hi Team
I am trying to put some sensors into my boat and a couple of them I am using a esp32. I haven't been able to locate a complete/ relevant guide to do what I need to do, some get me half the way there but not quite.
I have signalK running and 3 dallas 1 wire temp sensors are connected to the gpio on the raspberry pi and work great, gps on the pi works great.
Initially I was using the Arduino ide to upload some sketches to the esp32 and I managed to get it on the network, but it would not get to the point of a access request. I then tried using visual code studio and platformio, initally I could not get the connection to work via manual config but after wiping the esp32 and running the build process again, I was able to browse to its web server and connect it to the correct wifi network and then got an access request from signalk.
My code I have used a template, but had to comment a lot of things out that are not connected. I have connected a dallas 1 wire to the esp32 but am yet to get its path through to signalk - pretty sure its my code.
My main things I want to do with the 2 esp 32's is :
#1 4 temp sensors
#2 Rudder angle indicator, I have the KUS dual station angle sensor
Do I have to use platformio ?
Can anyone direct me to a template for what I am trying to do here ? Or a tutorial to help me build the code I need.
Beta Was this translation helpful? Give feedback.
All reactions