GithubHelp home page GithubHelp logo

project-hermes / hermes-sensor Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 2.0 654 KB

:no_entry:Depreciated:no_entry:

License: MIT License

OpenSCAD 89.81% C++ 10.19%
conservation iot oceanography particle particle-electron

hermes-sensor's People

Contributors

gitter-badger avatar johnsonm avatar sonyccd avatar

Watchers

 avatar  avatar  avatar

hermes-sensor's Issues

Update DeviceOS v0.5.4 -> v0.7.0

We need to update the OS as there are many bugs that have been fixed and the Serial Logging system is only available in this version and higher. See the link below for release info.
https://github.com/particle-iot/firmware/releases/tag/v0.6.0
Note we are upgrading to v0.6.4 as it will be the needed version to move to v0.7.0 in the future

v0.6.0 features that matter:

  • Logging library for flexible system and application logging
  • [Electron] Reduced data consumption connecting to the cloud with deep sleep. (See the Docs for how to gain the full data reduction.)
  • [Electron] Firmware Reset now available.
  • [Electron] now allows OTA bootloader updates
  • Added Daylight Saving Time support

Sensor checks if firmware has updated

On startup the sensor will check in EPROM if there is a version number. If there is none then we added one and hit the sensorCreate pub/sub. If there is a version number but it is not the same version than we update it and hit the snesorCreate pub/sub.

Depth?!?

Analyze raw logs, esp LOG00029

Create electronics tool kit

I need to set up a tool kit that will have everything to repair a sensor even on board the boat.
I should create the checklist in the wiki.

Electron power saving modes

  • When diving turn off cellular and GPS.
  • When at the surface
    • turn on GPS and keep on until we have a good lock (need to define good)
    • turn on cellular and check for signal
      • if we cant get cellular for more than 10 min they just turn off and try again in a half hour
  • Once data has been sent wait for (some time) then shut off, requiring the user to hit the on button to begin dive again.

Cant use SerialLogHandler

I can not seem to figure out how to use the serial logger. It creates an error every-time at compilation.
'SerialLogHandler' does not name a type
Searched everywhere and I can't see a need for an import or anything. I don't want to make an account with the particle community as they are not using single sign on. I did email them about that.

Device will default to "dev mode"

This will keep device in automatic mode, leave wifi one and keep OTA updates one for simple development. The device will also print out the dive data over serial logging.

Update Particle.publish() and Particle.subscribe()

Beginning with 0.8.0 release, Particle.publish() and Particle.subscribe() methods will require event scope to be specified explicitly. Please update your apps now to include the event scope to avoid compilation errors in >=0.8.0.

Define data structure for published readings

We need to define a structure to the data that will be sent out. We will not has the auto transmit be done with a publish for each data value. It would take up to much of the data plan.

Sensor can publish dive data to firebase app

See project-hermes/hermes-firebase#15

3 topics, 3 functions on sensor for firebase responses:

  1. Sensor: publish createDive(char format, int sensorDiveId, float latStart, longStart, latEnd, longEnd, int sampleCount, timestamp epochStart, epochEnd)
  • Firebase generates new Dive document with ID firebaseDiveId (hash of properties to tolerate repeat? If not, on repeat we get two partial dives and retry)
  • Firebase: poke sensor with readyToReceive(string firebaseDiveId, int sensorDiveId)
  1. Sensor: loop publish diveAppend(char format, int sensorDiveId, timestamp firstDataTime, 41x6byte(depth,temp1,temp2))
  • Firebase determines firebaseDiveId of "active" dive to which to append via one of three options:
    • stores both sensorDiveId and firebaseDiveId as "lastDiveId_sensor" and "lastDiveId_firebase" on the Sensor object, which it Gets
    • queries Dives that are children of this Sensor for most recent LastUpdatedAt or LastCreatedAt, uses that one (and still verifies sensorDiveId match); this avoids storing state on the Sensor
    • change message formate above: sensor sends full firebaseDiveId per packet (high overhead)
  1. Sensor: with tuned backoff, publish diveDone(char format, int sensorDiveId, string firebaseDiveId)
  • Firebase: count Data collection under active Dive: if == Dive.sampleCount, poke sensor with diveComplete(string firebaseDiveId, int sensorDiveId)
    -- non-response is "not done"

if Firebase ever errors, log error info under errorId, poke sensor with stopSending(string firebaseDiveId, int sensorDiveId, string errorId)

  • if we receive enough of these or otherwise have to resend 3 times
  • Sensor: emergency REST dump dive to raw-dive-dump endpoint for manual debugging and data recovery

Dump dive data to SD on full

RAM is too small for a long dive (e.g. nitrox); when we fill it, we need to dump to block storage. To save battery and prevent write latency from blocking data recording, we don't write to SD until we have a large block of data to write at once.

Obviously depends on #16

Electron produces status lights

  • Flash yellow for start up and sending data (this is basically the same thing)
  • Solid green for ready to dive
  • Pulse green for diving
  • Blink green when getting ready for next dive but not sending data
  • Flashing red for error
  • Solid red for FUBR

Define name for sensor system

We need a name for this damn thing. Any ideas? Hermes is the name of the project but I am not sure that will be a good name long term for the individual sensor.

Communication/processing protocol

initiate after 5 min good cell signal

Topic per sensor, shared cloud function

  1. Sensor sends dive header with dive info (ID, start/stop GPS and time, data point count)
  2. Firebase creates Dive, sends ACK via REST
  3. Sensor dumps data (dive ID x1 , data triplet xMany in each 255 byte packet)
  4. Sensor waits expected processing time, sends next dive header or Done (final header)
  5. Firebase checks if it got everything. If not, resend request via REST. If good, ACK next
  6. Sensor: On ACK done, can delete data. On resend, resend all (to be improved if not rare; we have to handle repeat data points anyway because of at-least-once guarantee on cloud functions).

If we have to resend some number of times, assume we have bad connection; signal to diver to press wake-up button later when they're in a different, hopefully better cell area; also stackdriver alert us about it.

Particle board is not connect to the cloud

The device is flashing blue very fast. The serial log shows it is trying to send HELLO but fails and keeps looping in this fail. Have tried the doctor to no success. Please help as we are doing field trials soon.

Logs are:

0000002065 [system] INFO: Sim Ready
0000002065 [system] INFO: ARM_WLAN_WD 1
0000002436 [system] INFO: ARM_WLAN_WD 2
0000002436 [system] INFO: CLR_WLAN_WD 1, DHCP success
0000002441 [system] WARN: Public Server Key was blank, restoring.
0000002443 [comm] INFO: channel inited
0000002444 [system] INFO: Cloud: connecting
0000002445 [system] WARN: Public Server Address was blank, restoring.
0000002445 [system] INFO: Read Server Address = type:1,domain:$id.udp.particle.io
0000004939 [system] INFO: Resolved host 1e0034001847373130353639.udp.particle.io to 54.157.13.160
0000005029 [system] INFO: Cloud socket connected
0000005029 [system] INFO: Starting handshake: presense_announce=0
0000005030 [comm.protocol.handshake] INFO: Establish secure connection
0000005039 [comm.dtls] INFO: (CMPL,RENEG,NO_SESS,ERR) restoreStatus=2
0000010642 [comm.protocol.handshake] INFO: Sending HELLO message
0000079000 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 0
0000079000 [comm.protocol.handshake] ERROR: Could not send HELLO message: 10
0000079001 [system] INFO: Send event spark/device/key/error=5
0000079001 [system] WARN: Cloud handshake failed, code=10
0000079251 [system] INFO: Cloud: disconnecting
0000080781 [system] INFO: Cloud: disconnected
0000080781 [system] INFO: Cloud: connecting
0000080782 [system] WARN: Public Server Address was blank, restoring.
0000080783 [system] INFO: Read Server Address = type:1,domain:$id.udp.particle.io
0000083176 [system] INFO: Resolved host 1e0034001847373130353639.udp.particle.io to 54.157.249.252
0000083196 [system] INFO: Cloud socket connected
0000083197 [system] INFO: Starting handshake: presense_announce=0
0000083197 [comm.protocol.handshake] INFO: Establish secure connection
0000083206 [comm.dtls] INFO: (CMPL,RENEG,NO_SESS,ERR) restoreStatus=2
0000088791 [comm.protocol.handshake] INFO: Sending HELLO message

It will loop like this over and over.

Have talked with the support they think it is a corrupted key.

There solutions is as follows:

It is possible that you have corrupted device keys. Since it's easy to fix them, it's a good thing to start with.

Put the Electron in DFU mode by holding down both the RESET and MODE buttons, releasing RESET and continuing to hold down MODE until it blinks yellow and issue the commands below, in order.

particle keys server
particle keys doctor 1e0034001847373130353639
If you get this error under Windows:

'openssl' is not recognized as an internal or external command, operable program or batch file.
and you have used the CLI installer as described above, it may work if you do:

cd c:\OpenSSL-Win32\bin
particle keys doctor 1e0034001847373130353639
There are additional tips for a missing openssl error on this page, including tips for Mac OS X and Linux.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.