Posts: 175
Threads: 14
Joined: Nov 2020
Reputation:
17
(2022-07-22, 05:03 AM)Techstyle Wrote: @boatingbaileys
I just tried your main.cpp but you may want to include in the readme that you have to add a couple of dependencies to the 'lib deps' section of platformio.ini - the bottom two lines:
Code: lib_deps =
; Peg the SensESP version to 2.0.0 and compatible versions
SignalK/SensESP @ ^2.0.0
; Add any additional dependencies here
adafruit/Adafruit BMP280 Library@^2.6.3
SensESP/OneWire@^2.0.0
I have your code up and running, now I am going to rewatch the episodes to try to decipher what's happening and how to connect it all up - thanks
Thanks for that - Completly forgot about the lib_deps. i'll update it now.
Posts: 338
Threads: 34
Joined: Oct 2019
Reputation:
30
@boatingbaileys
I got some of my project up and running:
1. I adapted your Coolant sender code to work with my oil Pressure sender. Haven't tried it yet but used a different scale table to map the resistance to the oil pressure, obviously
2. Added 6 onewire sensors for a variety of stuff, tested and works well - oil temp, Aft Stateroom temp, Exhaust Elbow temp, Exhaust temp, Alternator Temp, and Transmission Temp
3. Adapted your BMP280 code to the BME280, which seemed straight forward at first but it is not working, struggling a bit with it
4. Used your RPM code as is, not tested yet
5. Used your fuel consumption code but with a new fuel map for my engine and I changed the Signal K Key "propulsion.engine.fuel.rate", this comes with known units - m^3/s. m^3/s is a bit inconvenient but is more correct by the Signal K Spec. It does mean that the fuel map needs to be changed.
6. another change I made was for consistency some of your Signal K keys state "propulsion.main.<whatever>" and some are "propulsion.engine.<whatever>". I believe "main" refers to main engine and "engine" refers to the only engine - I commonised on "engine" for all of them
I do fancy adding a flood sensor like you talk about for under the engine bay and near the raw water thru hull
thanks again for all this work
Posts: 338
Threads: 34
Joined: Oct 2019
Reputation:
30
(2022-07-28, 02:55 AM)Techstyle Wrote: @boatingbaileys
I got some of my project up and running:
1. I adapted your Coolant sender code to work with my oil Pressure sender. Haven't tried it yet but used a different scale table to map the resistance to the oil pressure, obviously
2. Added 6 onewire sensors for a variety of stuff, tested and works well - oil temp, Aft Stateroom temp, Exhaust Elbow temp, Exhaust temp, Alternator Temp, and Transmission Temp
3. Adapted your BMP280 code to the BME280, which seemed straight forward at first but it is not working, struggling a bit with it
4. Used your RPM code as is, not tested yet
5. Used your fuel consumption code but with a new fuel map for my engine and I changed the Signal K Key "propulsion.engine.fuel.rate", this comes with known units - m^3/s. m^3/s is a bit inconvenient but is more correct by the Signal K Spec. It does mean that the fuel map needs to be changed.
6. another change I made was for consistency some of your Signal K keys state "propulsion.main.<whatever>" and some are "propulsion.engine.<whatever>". I believe "main" refers to main engine and "engine" refers to the only engine - I commonised on "engine" for all of them
I do fancy adding a flood sensor like you talk about for under the engine bay and near the raw water thru hull
thanks again for all this work
I am also wondering if the BME280 issues are something to do with my platformio - for whatever reason, I cannot compile successfully when Firebeetle32 is selected as the board - Mat - any chance you could post your platformio.ini file?
Posts: 175
Threads: 14
Joined: Nov 2020
Reputation:
17
(2022-07-28, 05:46 PM)Techstyle Wrote: (2022-07-28, 02:55 AM)Techstyle Wrote: @boatingbaileys
I got some of my project up and running:
1. I adapted your Coolant sender code to work with my oil Pressure sender. Haven't tried it yet but used a different scale table to map the resistance to the oil pressure, obviously
2. Added 6 onewire sensors for a variety of stuff, tested and works well - oil temp, Aft Stateroom temp, Exhaust Elbow temp, Exhaust temp, Alternator Temp, and Transmission Temp
3. Adapted your BMP280 code to the BME280, which seemed straight forward at first but it is not working, struggling a bit with it
4. Used your RPM code as is, not tested yet
5. Used your fuel consumption code but with a new fuel map for my engine and I changed the Signal K Key "propulsion.engine.fuel.rate", this comes with known units - m^3/s. m^3/s is a bit inconvenient but is more correct by the Signal K Spec. It does mean that the fuel map needs to be changed.
6. another change I made was for consistency some of your Signal K keys state "propulsion.main.<whatever>" and some are "propulsion.engine.<whatever>". I believe "main" refers to main engine and "engine" refers to the only engine - I commonised on "engine" for all of them
I do fancy adding a flood sensor like you talk about for under the engine bay and near the raw water thru hull
thanks again for all this work
I am also wondering if the BME280 issues are something to do with my platformio - for whatever reason, I cannot compile successfully when Firebeetle32 is selected as the board - Mat - any chance you could post your platformio.ini file?
Will do, and will respond to the above. Currently got limited access to internet but will be back i a couple of days.
Posts: 338
Threads: 34
Joined: Oct 2019
Reputation:
30
(2022-07-30, 10:58 PM)Boatingbaileys Wrote: Will do, and will respond to the above. Currently got limited access to internet but will be back i a couple of days.
Thanks, actually I got it working, I had to add some code to get the I2C interface to work. I had to define the pins
where 22 is the SCL pin and 21 is the SDA pin.
I think you may have got around this by better defining the board you were using, but I had trouble with that in version 2.
Posts: 175
Threads: 14
Joined: Nov 2020
Reputation:
17
(2022-08-01, 04:54 AM)Techstyle Wrote: (2022-07-30, 10:58 PM)Boatingbaileys Wrote: Will do, and will respond to the above. Currently got limited access to internet but will be back i a couple of days.
Thanks, actually I got it working, I had to add some code to get the I2C interface to work. I had to define the pins
where 22 is the SCL pin and 21 is the SDA pin.
I think you may have got around this by better defining the board you were using, but I had trouble with that in version 2.
Took me a little longer to get back to this, but I have had a look through the code, and I've not needed to define this. It looks like it set the ports up for me, I know I had to change to 0x76 for mine, but the pins appear to have been defined. Glad its working!
Posts: 338
Threads: 34
Joined: Oct 2019
Reputation:
30
2022-08-25, 06:27 PM
(This post was last modified: 2022-08-25, 06:27 PM by Techstyle.)
I am now trying to get the RPM sensor to work for me, it seems you made your own board, but I already had a Optocoupler board based on the EL817 that I used for my ST1 connection ( https://amzn.to/3Kkoy2q). Running the code below:
Code: (new DigitalInputCounter(RPM_PIN, INPUT_PULLUP, RAISING, 500))
it seems the voltage to at the pin never drops, I think I should try:
Code: (new DigitalInputCounter(RPM_PIN, INPUT_PULLDOWN, FALLING, 500))
any thoughts?
Posts: 175
Threads: 14
Joined: Nov 2020
Reputation:
17
(2022-08-25, 06:27 PM)Techstyle Wrote: I am now trying to get the RPM sensor to work for me, it seems you made your own board, but I already had a Optocoupler board based on the EL817 that I used for my ST1 connection (https://amzn.to/3Kkoy2q). Running the code below:
Code: (new DigitalInputCounter(RPM_PIN, INPUT_PULLUP, RAISING, 500))
it seems the voltage to at the pin never drops, I think I should try:
Code: (new DigitalInputCounter(RPM_PIN, INPUT_PULLDOWN, FALLING, 500))
any thoughts? Yeah, I think that might work. Are you seeing a change in voltage from the alternator side at all? It’s a Yanmar engine?
Posts: 69
Threads: 3
Joined: Aug 2021
Reputation:
3
(2022-04-01, 10:40 PM)tYuoAz Wrote: I'm working on the same project right now!
Using a Sailor Hat board which has an ESP32 built in. I've also got the engine hat add on for the SH-ESP32 and almost have everything working. Currently working on trying to get oil pressure sorted out.
Do you have any code on github to share? I'd love to see how you did it.
If anyone doesn't know this is the ESP32 board I mentioned. It's main benefit is that it can be 12v powered and has a CAN bus input if you want to use it with N2K.
https://hatlabs.fi/product/sailor-hat-wi...16fd43adaa
What a great idea! I have only seen the Raspberry pi version of this HAT previously but it looks to be a very useful and well specified board (the ESP32 version especially) with protected PSU and protected I/O as well as EMC certification and SensESP support. Are you making use of the NMEA2000 interface?
Paul
Posts: 175
Threads: 14
Joined: Nov 2020
Reputation:
17
Hi,
I've now added a bilge monitor to this using a cheap float switch. The code on the website and in the video returns true or false, but thanks to a subscriber i'm updating that with the below so that i can return a string of text. Here is the updated code:
auto* bilge = new DigitalInputState(25, INPUT_PULLUP, 5000);
auto int_to_string_function = [](int input) ->String {
if (input == 1) {
return "Water present!";
}
else { // input == 0
return "bilge clear";
}
};
auto int_to_string_transform = new LambdaTransform<int, String>(int_to_string_function);
bilge->connect_to(int_to_string_transform)
->connect_to(new SKOutputString("propulsion.engine.bilge"));
Hope this is helpful.
|