Projets-2016-2017-Serres connectées: Difference between revisions

From air
Jump to navigation Jump to search
Line 147: Line 147:
== Week 10 (March 13th - March 20th) ==
== Week 10 (March 13th - March 20th) ==


* We produced two codes, by forking the SX1272Ping-Pong program :
* https://developer.mbed.org/users/Antoine38/code/SX1272-Transmitter/
* https://developer.mbed.org/users/Antoine38/code/SX1272-Receiver/
** A transmitter : https://developer.mbed.org/users/Antoine38/code/SX1272-Transmitter/
** A receiver : https://developer.mbed.org/users/Antoine38/code/SX1272-Receiver/

*


= Materials =
= Materials =

Revision as of 16:11, 13 March 2017

Project presentation

Sky view of the exploitation (© Google Maps)

The project subject : Serres connectées.

The project consist of upgrading a classic greenhouse to retrieve live information about its climate. The farm exploitation is located in Saint-Cassien (38500), in the French Alps.

Data to retrieve :

  • Air temperature
  • Air moisture
  • Soil moisture

Control of these parameters are essentials to avoid disease, enhance the growth of the plantations and limit water consumption.

Two main constrains :

  • No power in the zone
  • Sensors needs to be moveable to let vehicles move along the greenhouse



Team

  • Supervisor: Nicolas Palix and Vincent Hibon

Documents

Calendar

The project started on January 9th, 2017.

Week 1 (January 9th - January 12th)

Week 2 (January 13th - January 19th)

  • Introduction to LoRa by Didier Donsez.
  • Discovery of the project
  • Setup of our computers to be able to program our Adafruit Feather.
  • First Hello world with the hardware (Discussion between two Adafruit Feather 32u4 in LoRa)
  • Call with one of the managers of the farm, Vincent, the feeling is good with him, we spoke during one hour :
    • He spoke about him and his wife farm exploitation
    • He detailed the farm layout
    • We asked him some precise questions about the project (Types and numbers of sensors wanted, data wanted, ...)
    • We agree on a meeting for the next Wednesday (25/01/2017)

Week 3 (January 20th - January 26th)

  • Define the use case diagram
  • Taking charge of the Adafruit Feather card and the PyCom one.
  • We wrote a little program that is able to send and receive data. At the moment these data are fake temperature until we embedded real sensors
  • We determinate the length maximum of data that we can sent to be able to record data each 30 minutes and respect the duty cycle (1% of the time)
  • The meeting was canceled by the managers of the farm and reported to the 8th of February

Week 4 (January 27th - February 5th)

  • No official time slot for the projec this week (Postpouned)
  • Call with Vincent Hibon on the 1st of Feb. We spoke about the advancement of the project.

Week 5 (February 6th - February 12th)

  • We got some new hardware : Mbed SX1272 with a ST Nucleo board, therefore we have to re-setup our computers to makes these cards working. Adafruit cards will be given to the project n°2.
  • On wednesday afternoon, first meeting at the farm with Vincent. We also meet Isabelle, Vincent's wife, the manager of the farm. Here is a report of this afternoon (in French).
  • There are some pictures picked today (yes, the forecast wasn't very good...) :
General view of the greenhouses
Inside view of a greenhouse

Week 6 (February 13th - February 19th)

  • Monday:
    • We are very disheartened with these new STM32 cards. Three other hours lost in making research about how to make it works.
  • Tuesday:
    • Nice day ! Finally STM32 worked today, we were able to run the "PingPong" example program (link) and exchange some data
    • We are able to transform voltage from the temperature sensor[1] to degree celsius.
    • NB: We use picocom /dev/tty.usbmodem1423 on macOS 10.12 and Putty (/dev/ttyACM0) on Ubuntu to have a console output.

Week 7 (February 20th - February 26th)

Week 8 (February 27th - March 5th)

  • Going to the FabLab in order to carve the model. The base is made of MDF (Medium-density fiberboard) and the structure is made of Plexiglas.
Greenhouse model
Greenhouse model
  • Set-up Node-red, we are able to retrieve data printed by the device (connected on /dev/ttyACM0)
    • The Extract data function :
setTimeout(function() { node.status({}); }, 500)
node.status({fill:"green",shape:"dot",text:"updated"});
return msg;
Node-red dashboard

Week 9 (March 6th - March 12th)

  • Node-red, Mosquitto, InfluxDB and Grafana
Grafana screenshot
  • Our two node-red flow :

[ {"id":"bf6a6bfb.ad6698","type":"tab","label":"Flow 1"}, {"id":"48fb29d6.8abc8","type":"tab","label":"Flow 2"}, {"id":"a6ed7ef6.c3b1b","type":"serial-port","z":"","serialport":"/dev/tty.usbmodem1423","serialbaud":"9600","databits":"8","parity":"none","stopbits":"1","newline":"\\n","bin":"false","out":"char","addchar":false}, {"id":"cd1cd4b5.89a1b8","type":"mqtt-broker","z":"","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"willTopic":"","willQos":"0","willPayload":"","birthTopic":"","birthQos":"0","birthPayload":""},{"id":"45f90f43.5971c8","type":"influxdb","z":"","hostname":"localhost","port":"8086","protocol":"http","database":"iotdb","name":""}, {"id":"adb5fbbd.36c6d8","type":"influxdb","z":"","hostname":"127.0.0.1","port":"8086","protocol":"http","database":"yyu","name":""},{"id":"c74aaa1a.718428","type":"serial in","z":"bf6a6bfb.ad6698","name":"USBModem1423 (9600)","serial":"a6ed7ef6.c3b1b","x":190.5,"y":300,"wires":[["a999cf.d1e0163"]]}, {"id":"a999cf.d1e0163","type":"function","z":"bf6a6bfb.ad6698","name":"debugFunction","func":" setTimeout(function() { node.status({}); }, 500)\n\n node.status({fill:\"green\",shape:\"dot\",text:\"updated\"});\n\n return msg;","outputs":1,"noerr":0,"x":567.5,"y":237,"wires":[["bedd3839.57329"]]},{"id":"bedd3839.57329","type":"mqtt out","z":"bf6a6bfb.ad6698","name":"","topic":"iotdays/sensors","qos":"","retain":"","broker":"cd1cd4b5.89a1b8","x":956.5,"y":243,"wires":[]},{"id":"5c859882.c8211","type":"mqtt in","z":"48fb29d6.8abc8","name":"","topic":"iotdays/sensors","qos":"2","broker":"cd1cd4b5.89a1b8","x":323.5,"y":261,"wires":[["2b58b71.959ec48","a8ea218a.b140b8"]]}, {"id":"2b58b71.959ec48","type":"debug","z":"48fb29d6.8abc8","name":"","active":true,"console":"false","complete":"payload","x":768.5,"y":138,"wires":[]}, {"id":"a8ea218a.b140b8","type":"influxdb out","z":"48fb29d6.8abc8","influxdb":"45f90f43.5971c8","name":"IoT DB temperature","measurement":"temperature","x":734.5,"y":399,"wires":[]} ]

  • We produced the Eclipse IoT Day Poster, here is the final version
  • Demo at the Eclipse IoT Day 2017 (Resume coming soon)
  • Second version with multiple measurements :

[{"id":"bf6a6bfb.ad6698","type":"tab","label":"Flow 1"},{"id":"48fb29d6.8abc8","type":"tab","label":"Flow 2"},{"id":"a6ed7ef6.c3b1b","type":"serial-port","z":"","serialport":"/dev/tty.usbmodem1423","serialbaud":"9600","databits":"8","parity":"none","stopbits":"1","newline":"\\n","bin":"false","out":"char","addchar":false},{"id":"cd1cd4b5.89a1b8","type":"mqtt-broker","z":"","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"willTopic":"","willQos":"0","willPayload":"","birthTopic":"","birthQos":"0","birthPayload":""},{"id":"45f90f43.5971c8","type":"influxdb","z":"","hostname":"localhost","port":"8086","protocol":"http","database":"iotdb","name":""},{"id":"adb5fbbd.36c6d8","type":"influxdb","z":"","hostname":"127.0.0.1","port":"8086","protocol":"http","database":"yyu","name":""},{"id":"c74aaa1a.718428","type":"serial in","z":"bf6a6bfb.ad6698","name":"USBModem1423 (9600)","serial":"a6ed7ef6.c3b1b","x":180.5,"y":321,"wires":[["a999cf.d1e0163"]]},{"id":"a999cf.d1e0163","type":"function","z":"bf6a6bfb.ad6698","name":"debugFunction","func":" setTimeout(function() { node.status({}); }, 500)\n\n node.status({fill:\"green\",shape:\"dot\",text:\"updated\"});\n\n return msg;","outputs":1,"noerr":0,"x":583.5,"y":278,"wires":[["bedd3839.57329"]]},{"id":"bedd3839.57329","type":"mqtt out","z":"bf6a6bfb.ad6698","name":"","topic":"iotdays/sensors","qos":"","retain":"","broker":"cd1cd4b5.89a1b8","x":956.5,"y":243,"wires":[]},{"id":"2b58b71.959ec48","type":"debug","z":"48fb29d6.8abc8","name":"","active":true,"console":"false","complete":"true","x":814.5,"y":323,"wires":[]},{"id":"a52ed1fe.56465","type":"function","z":"48fb29d6.8abc8","name":"Set Measurement","func":"var prefixT = \"Temp=\";\nvar prefixH = \"Humi=\";\n\nvar m = msg.payload;\n\nvar t = m.indexOf(prefixT);\nvar h = m.indexOf(prefixH);\n\nif(t === 0 || h === 0) {\n msg.payload = m.substr(prefixT.length).trim(); // prefixT.length == prefixH.length\n msg.measurement = (t === 0 ? \"temperature\" : \"humidity\");\n setTimeout(function() { node.status({}); }, 500)\n node.status({fill:\"green\",shape:\"dot\",text:\"updated\"});\n return msg;\n} else {\n return null;\n}","outputs":1,"noerr":0,"x":530,"y":441,"wires":[["fd9f5fc1.24d15","2b58b71.959ec48"]]},{"id":"ccd5b74a.579bb8","type":"mqtt in","z":"48fb29d6.8abc8","name":"","topic":"iotdays/sensors","qos":"2","broker":"cd1cd4b5.89a1b8","x":239,"y":441,"wires":[["a52ed1fe.56465"]]},{"id":"fd9f5fc1.24d15","type":"influxdb out","z":"48fb29d6.8abc8","influxdb":"45f90f43.5971c8","name":"IoT DB","measurement":"","x":806,"y":443,"wires":[]}]

  • Demonstration with the greenhouse mockup at the Eclipse IoT Days 2017 :
    • We explained the project and made some demonstrations with the mockup and live data (and Grafana).
    • During this day we were present at the SigFox presentation.
Mock-up2.jpg
Mock-up3.jpg
Mock-up1.jpg
Oriane DALLE and Antoine BOISADAM on this project. Charles MARCHAND and Marion PELLICIER on the Serre connectée acquaponie project


Week 10 (March 13th - March 20th)

Materials

Thermometer, barometer, moisture sensor
Nucleo LR073RZ with SX1272 LoRa shield
Pycom
Pycom_Lo
Electronic test plate
Solar panel
Waterproof case