Tikkun-olam / angelzzz

A sleep and (hopefully) seizure detector for kids with Angelman Syndrome using a beddit 1 sensor
GNU General Public License v3.0
0 stars 1 forks source link

Make Angelzzz good enough to be autonomus at need-knower's house #2

Open guysoft opened 7 years ago

guysoft commented 7 years ago

Continuing the talks at #1 Started with @arnonzamir The proof-of-concept it working nicely, however we need the pi to handle communication exception and basically crash as little as possible.

work is done in the auto_connect branch

The main issues at the moment are:

  1. Migrate from python-serial to python-bluez done
  2. Handle "device resource is busy" errors Done
  3. Handle "invalid CRC" messages that are a result of not all the packets arriving on time done
  4. Handle "Host is down" errors that happen when the bluetooth device (beddit) is not visible to the pi Done
  5. Handle beddit diying after 30-60 mins and require restart
  6. Have a running service on the pi Done
guysoft commented 7 years ago

Ok, bluez now reconnects on connection fails, however it seem like after a few minutes the beddit stops working and timeouts, and the only way to fix it is restarting. In the README there is a documentation about a CONT variable, will try that.

guysoft commented 7 years ago

Merged auto_connect branch to devel, its better than what was there

guysoft commented 7 years ago

ok, good news - I gave up on making the remote connection stable, we are going to use a relay to turn the beddit on and off. Its been running for over 24 hours, so I merged the relay branch to devel.

The current solutions are either using a ORVIBO WiWo-S20, which has several implementations to be controlled, or just have an RF connection to the pi. I am using the Pi GPIO now to test, while I ordered a ORVIBO WiWo-S20. There is a new config.ini which lets you set which relay is being used.

guysoft commented 7 years ago

Ok, added support to ORVIBO WiWo-S20, a web service, and db all check out. This should be deployable at the need-knower's house. However setup has some requirements. So we will need to figure that out. cc @arnonzamir