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
SenseHat and Nodered-freeboard
#1
Hi all.
My name is Benjamin. I'm a marine electrician, who is working with a project onboard my own boat. I'm very good at the electrics and electronic, but when it comes to coding... well... 

I can start explaining my project:

I would like to make a digital experience in the boat. I have now a Raspberry PI 3 running OpenPlotter with a sensehat attatch. The Raspberry will be mounted in the saloon and will be the main gateway for signalK and NodeRed. 

In the aft cabin I will have a Raspberry Pi with 7" touchscreen running Jessie and install OpenCPN. It is the main cabin so I like to see whats going on outside when i'm not on watch.

In the navigationarea there will be a Raspberry Pi running Plex Media Server, A denkovi swichboard(https://denkovi.com/internet-ethernet-12...o-snmp-web), and the router. Everything, exept the tablets will be wirered together with ethernetcable.

Outside I have a Garmin radar on ethernet and a Garmin 4012 on ethernet too. 

The idea is, that with a tablet I'll have access to the freeboard wireless and be able to control lights, fridge, pumps and so on. I'll also have access to the Plex Server with all our movies. And offcourse the OpenCPN. 

A little tablet, like the iPhone touch, will be at the toilet to view tankstate and control of the electric toilet ect ect ect...

Right now im working on the one with OpenPlotter. I would like to get access to a dashboard in nodered like the freeboard, where I can see wind(speed and direction), boat speed over ground, temperature inside(sensehat), humidity(sensehat) and pressure(sensehat). 

Know I came to the first problem. 

How the F*** do I get the information from my sensehat to the Freeboard? Wink
I've tryed allmost everything in my mind and search hundreds of webpages without answer Sad

Next; I have no clue about how to control the swichboard using nodeRED. i would like a dashboard with 12 swiches.. 


Do anybody have the time to help get going? Please?

I've tryet a lot on my own and came nowhere....
Reply
#2
(2017-06-22, 01:11 PM)benjamingotke Wrote: Hi all.
My name is Benjamin. I'm a marine electrician, who is working with a project onboard my own boat. I'm very good at the electrics and electronic, but when it comes to coding... well... 

I can start explaining my project:

I would like to make a digital experience in the boat. I have now a Raspberry PI 3 running OpenPlotter with a sensehat attatch. The Raspberry will be mounted in the saloon and will be the main gateway for signalK and NodeRed. 

In the aft cabin I will have a Raspberry Pi with 7" touchscreen running Jessie and install OpenCPN. It is the main cabin so I like to see whats going on outside when i'm not on watch.

In the navigationarea there will be a Raspberry Pi running Plex Media Server, A denkovi swichboard(https://denkovi.com/internet-ethernet-12...o-snmp-web), and the router. Everything, exept the tablets will be wirered together with ethernetcable.

Outside I have a Garmin radar on ethernet and a Garmin 4012 on ethernet too. 

The idea is, that with a tablet I'll have access to the freeboard wireless and be able to control lights, fridge, pumps and so on. I'll also have access to the Plex Server with all our movies. And offcourse the OpenCPN. 

A little tablet, like the iPhone touch, will be at the toilet to view tankstate and control of the electric toilet ect ect ect...

Right now im working on the one with OpenPlotter. I would like to get access to a dashboard in nodered like the freeboard, where I can see wind(speed and direction), boat speed over ground, temperature inside(sensehat), humidity(sensehat) and pressure(sensehat). 

Know I came to the first problem. 

How the F*** do I get the information from my sensehat to the Freeboard? Wink
I've tryed allmost everything in my mind and search hundreds of webpages without answer Sad

Next; I have no clue about how to control the swichboard using nodeRED. i would like a dashboard with 12 swiches.. 


Do anybody have the time to help get going? Please?

I've tryet a lot on my own and came nowhere....

Hi Benjamin,   Sounds like an interesting project Cool  

Ok, first to control / read the gpio pins - if you go into the node red webpage .... actually before we even go there - I can't get on with the web browser on the Pi, just too slow so always use a laptop, you might know this already. So if you have a laptop connected to the openplotter access point - in a web browser put into the address bar this - 10.10.10.1:1880 . Or if you have the Pi connected to a wifi network look in the wifi tab to see its IP address - it will be something like 192.168.43.76 so put into the laptop address bar 192.168.43.76:1880

So now you should be looking at node-red.  Next type control-i    , this will bring up the import node box then copy this and paste it in there then hit OK then deploy.

Code:
[
   {
       "id": "6d202483.d9e2ac",
       "type": "inject",
       "z": "dcf0a43.0c79158",
       "name": "Turn on",
       "topic": "",
       "payload": "true",
       "payloadType": "bool",
       "repeat": "",
       "crontab": "",
       "once": false,
       "x": 174,
       "y": 137,
       "wires": [
           [
               "db30ef38.e9e96"
           ]
       ]
   },
   {
       "id": "db30ef38.e9e96",
       "type": "rpi-gpio out",
       "z": "dcf0a43.0c79158",
       "name": "Pin 7 output",
       "pin": "7",
       "set": true,
       "level": "0",
       "out": "out",
       "x": 447,
       "y": 171,
       "wires": []
   },
   {
       "id": "31ea454f.1879ea",
       "type": "rpi-gpio in",
       "z": "dcf0a43.0c79158",
       "name": "Pin 12 input",
       "pin": "12",
       "intype": "down",
       "debounce": "25",
       "read": true,
       "x": 185,
       "y": 239,
       "wires": [
           [
               "f13c1c8b.25062"
           ]
       ]
   },
   {
       "id": "f13c1c8b.25062",
       "type": "debug",
       "z": "dcf0a43.0c79158",
       "name": "",
       "active": true,
       "console": "false",
       "complete": "false",
       "x": 432,
       "y": 235,
       "wires": []
   },
   {
       "id": "1a2f5872.f43fa8",
       "type": "inject",
       "z": "dcf0a43.0c79158",
       "name": "Turn off",
       "topic": "",
       "payload": "false",
       "payloadType": "bool",
       "repeat": "",
       "crontab": "",
       "once": false,
       "x": 168,
       "y": 184,
       "wires": [
           [
               "db30ef38.e9e96"
           ]
       ]
   }
]

Now you should see this->
[Image: zqMBenj.png]

So if you click the tab on the left hand side of the "turn on" box, the Pi gpio pin 7 should go 'high', or to 3.3v. I use these transistors as switches - BUK553 - they work at 'logic level', or 3.3v. So the GPIO pin can turn on and off lights or whatever.  The input below will read what's going on with pin 12, if nothing is connected it will read '0', if it sees 3.3v it will read '1'. Careful here,  put more than 3.3v on the gpio pins and you can damage the Pi. 

Next try this one - 

Code:
[
   {
       "id": "fd28afdd.25207",
       "type": "websocket in",
       "z": "dcf0a43.0c79158",
       "name": "SignalK input",
       "server": "8d5a3102.d114b",
       "client": "",
       "x": 195,
       "y": 133,
       "wires": [
           [
               "c33ea85.0d42a58"
           ]
       ]
   },
   {
       "id": "c33ea85.0d42a58",
       "type": "json",
       "z": "dcf0a43.0c79158",
       "name": "",
       "x": 396,
       "y": 213,
       "wires": [
           [
               "5e6fdd7.75d2d24"
           ]
       ]
   },
   {
       "id": "5e6fdd7.75d2d24",
       "type": "jsonpath",
       "z": "dcf0a43.0c79158",
       "expression": "$.updates..values[?(@.path==\"navigation.position\")]..value",
       "split": true,
       "name": "lat and long",
       "x": 564,
       "y": 203,
       "wires": [
           [
               "dcd20419.ead918"
           ]
       ]
   },
   {
       "id": "dcd20419.ead918",
       "type": "debug",
       "z": "dcf0a43.0c79158",
       "name": "",
       "active": true,
       "console": "false",
       "complete": "false",
       "x": 732,
       "y": 138,
       "wires": []
   },
   {
       "id": "8d5a3102.d114b",
       "type": "websocket-listener",
       "z": "",
       "path": "ws://localhost:3000/signalk/v1/stream",
       "wholemsg": "false"
   }
]
Import that and you should see Lat and Long in the debug window, assuming you have lat and long coming from a GPS into signlk of course.

So very rough and ready but hopefully that will get you started, ask away if you get stuck- this forum might take a day or 2 for someone to reply but normally help is here. Enjoy Smile

Node red is really powerful, thermometers especially can be really useful, this is my main page -

[Image: 3unAYRf.png]
Reply
#3
Thanks for answer. I got the SenseHat imported in nodeRED with a sensehat-node.
To get it right into freeboard, I needed to make tree seperated notes. one for temperature, one for humidity and one for pressure. The reading are just not good. The temp says 36.13c, pressure is now 1019.84 which seems right, but have been up to 3939.98 which would be the end of the world.... The humidity is around 32.07... I'm inside my workshop with the AC going at 23C....
I'll transfer some screenshots later..

(2017-06-23, 02:32 PM)benjamingotke Wrote: Thanks for answer. I got the SenseHat imported in nodeRED with a sensehat-node.
To get it right into freeboard, I needed to make tree seperated notes. one for temperature, one for humidity and one for pressure. The reading are just not good. The temp says 36.13c, pressure is now 1019.84 which seems right, but have been up to 3939.98 which would be the end of the world.... The humidity is around 32.07... I'm inside my workshop with the AC going at 23C....
I'll transfer some screenshots later..

Here is my flow
   


And here is the code:

Code:
[{"id":"156f5475.15752c","type":"rpi-sensehat in","z":"29773d76.6254e2","name":"","motion":true,"env":true,"stick":false,"x":162,"y":58,"wires":[["7f851f82.12d62"]]},{"id":"c6e895cf.37dff8","type":"freeboard","z":"29773d76.6254e2","name":"sense temp","x":713,"y":59,"wires":[]},{"id":"7f851f82.12d62","type":"function","z":"29773d76.6254e2","name":"temperature","func":"var msg1;\nmsg.topic === 'environment'\nvar msg1 = { payload: msg.payload.temperature };\nreturn [ [msg1] ];","outputs":"1","noerr":0,"x":442,"y":55,"wires":[["c6e895cf.37dff8"]]},{"id":"948dff7.c79fb","type":"function","z":"29773d76.6254e2","name":"pressure","func":"var msg3;\nmsg.topic === 'environment'\nvar msg3 = { payload: msg.payload.pressure };\nreturn [ [msg3] ];","outputs":1,"noerr":0,"x":468,"y":238,"wires":[["99bf8390.18e2c"]]},{"id":"9b9ead35.7861e","type":"rpi-sensehat in","z":"29773d76.6254e2","name":"","motion":true,"env":true,"stick":true,"x":160,"y":250,"wires":[["948dff7.c79fb"]]},{"id":"40fc172f.73cd68","type":"rpi-sensehat in","z":"29773d76.6254e2","name":"","motion":true,"env":true,"stick":true,"x":148,"y":457,"wires":[["3072f2fa.0f327e"]]},{"id":"3072f2fa.0f327e","type":"function","z":"29773d76.6254e2","name":"humidity","func":"var msg2;\nmsg.topic === 'environment'\nvar msg2 = { payload: msg.payload.humidity };\nreturn [ [msg2] ];","outputs":1,"noerr":0,"x":458,"y":457,"wires":[["5c94ed7c.80ac64"]]},{"id":"99bf8390.18e2c","type":"freeboard","z":"29773d76.6254e2","name":"sense pressure","x":719,"y":230,"wires":[]},{"id":"5c94ed7c.80ac64","type":"freeboard","z":"29773d76.6254e2","name":"sense humidity","x":729,"y":456,"wires":[]}]

I'm looking at the swichboard too. There is some examples in the bottum of the link in my first post. Can any of these be used in nodered?
JAVA (SNMPv1) - Example how to set/get the DAEnetIP4 I/O status via SNMPv1 in Java (Netbeans Project).
JAVA (HTTP GET Requests) - Example how to set/get the DAEnetIP4 I/O status via HTTP GET Requests in Java (Netbeans Project).
LabVIEW 2011 - Example how to set/get the DAEnetIP4 I/O status via SNMPv1 in Labview 2011. The .exe file is in the directory "Executable".
VB.NET - Example how to set/get the DAEnetIP4 I/O status via SNMPv1 in Visual Basic .NET.
C#.NET - Example how to set/get the DAEnetIP4 I/O status via SNMPv1 in Visual C# .NET.
PHP Demo - Example how to set/get the DAEnetIP4 I/O status via SNMPv1 in PHP.
Delphi Lazarus - Example how to set/get the DAEnetIP4 I/O status via HTTP GET Requests
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)