tzachi-dar / LibreAllHouse

Use Raspberry pi devices to have all house coverage using the miaomiao device.
16 stars 12 forks source link

Can not upload to Mongo #3

Open yoxud opened 5 years ago

yoxud commented 5 years ago

Hi, I tried to setup a mongo db with mlab but was redirected to mongo cloud Atlas . The URI I am given to connect to my db by Mongo cloud is of the form mongodb+srv://url/db

If I remove the +srv, I get a communication error in screen.log. If I keep the +srv, I get the following error

caught exception in MongoThread, will soon continueThe "dnspython" module must be installed to use mongodb+srv:// URIsConfigurationError

so I installed dnspython through pip install dnspython but I am still getting the same error message. How may I upload to my mongo?

yoxud commented 5 years ago

Ok nevermind I got it to work. I think you should add in your instructions a line for a

sudo pip3 install dnspython

And in the config example, a remark that the port should be removed in the URI for mongodb+srv dbs.

Thank you for your work.

tzachi-dar commented 5 years ago

Can. You please give an example to such a connection string?

בתאריך יום ד׳, 20 במרץ 2019, 22:56, מאת yoxud ‏notifications@github.com:

Ok nevermind I got it to work. I think you should add in your instructions a line for a

sudo pip3 install dnspython

And in the config example, a remark that the port should be removed in the URI for mongodb+srv dbs.

Thank you for your work.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/tzachi-dar/LibreAllHouse/issues/3#issuecomment-475025032, or mute the thread https://github.com/notifications/unsubscribe-auth/AHkw5KsJU6ZLWwwZ72FjK-emCDNg8Ankks5vYqCOgaJpZM4cAAyF .

yoxud commented 5 years ago

This is what my config looks like

[MongoData] db_uri = mongodb+srv://USER:PASSWORD@URLPREFIX.mongodb.net db_name = DBNAME collection_name = COLLECTION

yoxud commented 5 years ago

Also can I ask you with multiple Pi receivers and one xdrip cell phone, there seem to be many possibilities for uploading to Nightscout. What is the recommended setup? 1.) pi receivers upload to NS mongo with xdrip cell hw source: bluetooth only +xdrip uploads to NS 2.) pi receivers do not upload to NS with xdrip cell sources : bluetooth for miao + wifi for the pis + xdrip uploading to NS 3.) All pi receivers upload to NS with xdrip cell hw source: bluetooth +wifi for pis + xdrip uploads to NS. I ask because I am afraid of the possibility of multiple conflictinguploaders to NS...

tzachi-dar commented 5 years ago

I'll try to make things clearer: First, the pis do not upload anything to NS at all. Only xdrip uploads things to nightscout.

The uploading to mongo is optional, most people don't need it. xDrip can read from the pis directly based on their wifi addresses. If xdrip and the pis are not on the same wifi network for any reason, than xdrip can read from the mongodb.

Next. xdrip has a mechanism to find duplicates and only upload one reading in 5 minutes. So, xdrip can (and probably should) be in a mode of wifi + libre. It can connect to multiple pis, while each pi is connected both on wifi and through mongo. The one who is closest to the miaomiao will connect to it will get the data.

xDrip will make sure that there are no duplicate data uploaded to nightscout.

yoxud commented 5 years ago

Ok. I thought the pi upload to mongo was designed for uploading to NS.Also unrelated to this but I have a lot of trouble using libreoop with xdrip. I keep getting no readings and an error message in libreoop : algorithm returned -1 apk file size 0. I got it to work on one phone but cant with the other. I have enabled broadcast and whitelisted both apps....

tzachi-dar commented 5 years ago

As for the libreoop problem. apk file size 0 means there was a problem creating the apk. Can you try running with the version from here: can you try the oop algorithm from here: https://drive.google.com/file/d/18zkgZq3ztNlgQZovKcE7ddO70PuawfBB/view?usp=drivesdk

yoxud commented 5 years ago

It worked. You saved me a lot of time, I was sure it was a setting.Thanks.