Smart Gadget Connec...
 

Smart Gadget Connection  

  RSS

eap904
(@eap904)
Active Member
Joined: 1 month ago
Posts: 8
15/08/2019 10:05 am  

Hi there, 

I finally got around to updating from mycodo v5 to 7, and am having trouble connecting to the Sensirion Smart Gadget. I put in the MAC address, and made sure the gadget is in wireless mode, but it doesn't connect. 

I had connected through the My Ambience app on my phone, and disconnected it to prevent conflict. 

Also, general inquiry about bluetooth devices, can multiple clients 'connect' to a device just to read data, or do they only support 1 paired client at a time... any resources on how it all works would be helpful.

Thank you Kyle!


Quote
Kyle Gabriel
(@kylegabriel)
Member Admin
Joined: 5 years ago
Posts: 0
15/08/2019 5:35 pm  

Only one device can be connected to the Smart Gadget at a time. What are your configuration settings for that input?

What version Raspberry Pi are you using? Is it using its integrated Bluetooth or an external USB module? Are there any lines in the Daemon Log to indicate what's going on? Have you enabled Log Level: Debug for the input and observed if there are errors appearing in the Daemon Log?


ReplyQuote
eap904
(@eap904)
Active Member
Joined: 1 month ago
Posts: 8
15/08/2019 7:50 pm  

RPI 3 A+ i believe, on board Bluetooth, the only configuration i had remembered was the Mac address. I tried increasing log interval to 60 seconds, the log did show a generic sounding error about not being able to connect, i will find the exact output. 

I will also look for debug log settings on the input


ReplyQuote
eap904
(@eap904)
Active Member
Joined: 1 month ago
Posts: 8
15/08/2019 9:20 pm  

B+


ReplyQuote
Kyle Gabriel
(@kylegabriel)
Member Admin
Joined: 5 years ago
Posts: 0
16/08/2019 9:16 pm  

Which Raspbian version are you running? You can determine it by going to the Info page ( https://IP_address/info) and looking for this line at the top:

Python Version: 3.7.3 (default, Apr 3 2019, 05:39:12) [GCC 8.2.0]

3.7.3 indicates version 10 (Buster).

Also, have you tried removing the battery from the Smart Gadget then putting it back in, then restarting the Pi?


ReplyQuote
eap904
(@eap904)
Active Member
Joined: 1 month ago
Posts: 8
19/08/2019 11:04 pm  

ok, got another pi here and another smart gadget to test. It's Mycodo Version 7.6.3 Raspbian Buster

When I enabled the debug logging for the gadget after adding it, the Error log says:
"

2019-08-19 22:55:37,789 - ERROR - mycodo.inputs.sht31_smart_gadget_eec29fcb - Initialize Error: Failed to connect to peripheral c4:3b:29:8b:8b:26, addr type: random
2019-08-19 22:55:37,789 - ERROR - mycodo.inputs.sht31_smart_gadget_eec29fcb - Could not connect: Failed to connect to peripheral c4:3b:29:8b:8b:26, addr type: random
2019-08-19 22:55:37,790 - ERROR - mycodo.controller_input_eec29fcb - StopIteration raised. Possibly could not read input. Ensure it's connected properly and detected.
2019-08-19 22:57:46,348 - ERROR - mycodo.inputs.sht31_smart_gadget_eec29fcb - Initialize Error: Failed to connect to peripheral C4:3B:29:8B:8B:26, addr type: random
2019-08-19 22:57:46,349 - ERROR - mycodo.inputs.sht31_smart_gadget_eec29fcb - InputModule raised an exception when taking a reading: 'NoneType' object has no attribute 'connect'

 

Debug log says:

2019-08-19 23:12:57,012 - DEBUG - mycodo.device.sht31_smart_gadget.sht31 - __prepareGadget()
2019-08-19 23:13:13,820 - DEBUG - mycodo.inputs.sht31_smart_gadget_eec29fcb - Connecting
2019-08-19 23:13:17,829 - DEBUG - mycodo.inputs.sht31_smart_gadget_eec29fcb - Acquiring lock for /var/lock/bluetooth_dev_hci0 (3600 sec timeout)
2019-08-19 23:13:17,831 - DEBUG - mycodo.inputs.sht31_smart_gadget_eec29fcb - Lock acquired for /var/lock/bluetooth_dev_hci0 in 0.002 seconds
2019-08-19 23:13:17,831 - DEBUG - mycodo.inputs.sht31_smart_gadget_eec29fcb - Starting measurement
2019-08-19 23:13:17,832 - DEBUG - mycodo.inputs.sht31_smart_gadget_eec29fcb - Input Initializing (Initialized: False)
2019-08-19 23:13:24,002 - DEBUG - mycodo.device.sht31_smart_gadget.delegate - SHT31Delegate Initialized
2019-08-19 23:13:24,003 - DEBUG - mycodo.device.sht31_smart_gadget.sht31 - __prepareGadget()
2019-08-19 23:13:36,519 - DEBUG - mycodo.inputs.sht31_smart_gadget_eec29fcb - Connecting
2019-08-19 23:13:47,740 - DEBUG - mycodo.inputs.sht31_smart_gadget_eec29fcb - Acquiring lock for /var/lock/bluetooth_dev_hci0 (3600 sec timeout)
2019-08-19 23:13:47,741 - DEBUG - mycodo.inputs.sht31_smart_gadget_eec29fcb - Lock acquired for /var/lock/bluetooth_dev_hci0 in 0.002 seconds
2019-08-19 23:13:47,742 - DEBUG - mycodo.inputs.sht31_smart_gadget_eec29fcb - Starting measurement
2019-08-19 23:13:47,742 - DEBUG - mycodo.inputs.sht31_smart_gadget_eec29fcb - Input Initializing (Initialized: False)
2019-08-19 23:14:07,765 - DEBUG - mycodo.device.sht31_smart_gadget.delegate - SHT31Delegate Initialized

you can see there I capitalized the letter characters in case that was an issue. 
This is a brand new smart gadget, not yet paired to anything. 

 

Thanks :)

This post was modified 4 weeks ago 2 times by eap904

ReplyQuote
Kyle Gabriel
(@kylegabriel)
Member Admin
Joined: 5 years ago
Posts: 0
19/08/2019 11:11 pm  

Is your Pi running the latest firmware? I would try running "sudo rpi-update" to eliminate that as a potential issue.


ReplyQuote
eap904
(@eap904)
Active Member
Joined: 1 month ago
Posts: 8
20/08/2019 1:10 pm  

I got it working after updating the firmware... kind of a bummer, I like to be able to buy a new pi and pop in a cloned SD card image, but it appears I'll have to manually update firmware on any new hardware used. 

Thanks again Kyle! I have been using pitunnel.com as an easy way to access web server abroad, and I think I can manage multiple mycodo servers via one interface via remote admin. 


ReplyQuote
eap904
(@eap904)
Active Member
Joined: 1 month ago
Posts: 8
20/08/2019 8:51 pm  

Doing some testing and it appears that the Smart Gadget was too far from the Rpi.

It seems that I have to have it right next to the rpi or it will not work, whereas the Sensirion app can detect it pretty far away. 

Through the bluetooth devices icon on the toolbar, I can see it show up in the list.. 


ReplyQuote
Kyle Gabriel
(@kylegabriel)
Member Admin
Joined: 5 years ago
Posts: 0
21/08/2019 2:04 pm  

I've been able to use my SG approx. 10 feet away through a plastic enclosure, so you should be able to have it further away than what you describe. The Bluetooth antenna of the Pi isn't great, so if you want more range, you may want to invest in a bluetootb USB dongle.


ReplyQuote