Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAC Address issue #61

Closed
Delgnelm opened this issue Dec 5, 2021 · 3 comments
Closed

MAC Address issue #61

Delgnelm opened this issue Dec 5, 2021 · 3 comments

Comments

@Delgnelm
Copy link

Delgnelm commented Dec 5, 2021

Hi,

It look like I have an issue with the MAC Address, and the YAML catch it like an interger...

Here is how the YAML (had to put a screenshot for the color):

devices:
  - mac: d8:**:**:**:**:20
    name: ****
refresh_interval: 150
retry_count: 10
retry_wait: 3
log_level: DEBUG
mqtt_discovery: 'true'

image

I've past several hours searching on google for this issue, but didn't find a method to pass it normally... I try simple and double quote, no success, each time the YAML comes back as show on the screenshot.

Hence here is my error message on Debug mode... Don't know if someone have a better understanding of my issue...

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[13:48:35] INFO: Getting mqtt configuration...
[13:48:35] INFO: Starting python script...
INFO:airthings-mqtt-ha:Setting up Airthings sensors...
DEBUG:airthings-mqtt-ha:Getting info about device(s)...
ERROR:airthings:Disconnected
Traceback (most recent call last):
  File "/src/airthings.py", line 228, in get_info
    char = self._dev.getCharacteristics(uuid=characteristic.uuid)[0]
  File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 508, in getCharacteristics
    rsp = self._getResp('find')
  File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 407, in _getResp
    resp = self._waitResp(wantType + ['ntfy', 'ind'], timeout)
  File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 362, in _waitResp
    raise BTLEDisconnectError("Device disconnected", resp)
bluepy.btle.BTLEDisconnectError: Device disconnected
WARNING:airthings-mqtt-ha:Unexpected exception while getting device information on attempt 1. Retrying in 3 seconds.

Thanks !

@sverrham
Copy link
Collaborator

sverrham commented Dec 5, 2021

It sounds like you are concerned that the last number in your mac is highlighted as an integer, this is just your editor highlighting it nothing else I would guess, not an issue.

Try it without the mac and see if it finds the device, should work... I think

Also It seems it was disconnected not anything wrong with the mac address...

@Delgnelm
Copy link
Author

Delgnelm commented Dec 5, 2021

Hi Sverre,

Thanks for your reply.

I retry without providing MAC addresses in the configuration.

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[15:07:49] INFO: Getting mqtt configuration...
[15:07:49] INFO: Starting python script...
WARNING:airthings-mqtt-ha:Invalid mac address provided: 
INFO:airthings-mqtt-ha:Setting up Airthings sensors...
INFO:airthings-mqtt-ha:No devices provided, so searching for Airthings sensors...
INFO:airthings-mqtt-ha:Starting search for Airthings sensors...
INFO:airthings-mqtt-ha:Found 1 airthings device(s).
---------------------------------
Suggested configuration is below:
 
devices:
  - mac: d8:**:**:**:**:20
    name: Insert Device Name
refresh_interval: 150
retry_count: 10
retry_wait: 3
log_level: INFO
mqtt_discovery: 'true'
 
---------------------------------
[15:07:56] INFO: Done.
[cmd] ./run.sh exited 0
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.

It's like on a loop, then sometimes I got this:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[15:09:24] INFO: Getting mqtt configuration...
[15:09:24] INFO: Starting python script...
WARNING:airthings-mqtt-ha:Invalid mac address provided: 
INFO:airthings-mqtt-ha:Setting up Airthings sensors...
INFO:airthings-mqtt-ha:No devices provided, so searching for Airthings sensors...
INFO:airthings-mqtt-ha:Starting search for Airthings sensors...
INFO:airthings-mqtt-ha:Found 0 airthings device(s).
WARNING:airthings-mqtt-ha:No airthings devices found. If the watchdog option is enabled, this addon will restart and try again.
[cmd] ./run.sh exited 1
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.

Then if I copy and paste the "Suggested configuration" I have the same error as my previous post....

I have first installed the Airthings app on my Smartphone and setup the Airthings device with it.
When trying to use this code, I shut down my cellphone bluetooth, to make sure the Airthings device is available, but I'm stuck with this error and disconnection.

@MartyTremblay
Copy link
Member

@Delgnelm, looks like you're using a different component and not this one. Your logs are showing that you are using the https://github.com/mjmccans/airthings-mqtt-ha project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants