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

Allow doors to be created via the admin panel #213

Closed

Conversation

proffalken
Copy link
Contributor

Fixes #210

This is may not be the best way to fix this, but it allows the creation of doors via the Django Admin interface.

Once they have been created, the platform works for connection from the Mainboard-firmware, however there is still an error produced by https://github.com/membermatters/MemberMatters/blob/main/memberportal/api_access/consumers.py#L60 so we probably need to put some better error handling in there at some point.

Sample logs with these changes in place:

System check identified no issues (0 silenced).
September 05, 2023 - 05:40:17
Django version 3.2.21, using settings 'membermatters.settings'
Starting ASGI/Channels version 3.0.5 development server at http://0.0.0.0:8000/
Quit the server with CONTROL-C.

2023-09-05 05:40:23,070 app INFO     Door connected!
<MAC_ADDR>
2023-09-05 05:40:23,225 app INFO     Got message from door (2): {'api_secret_key': '<SECRET>'}

2023-09-05 05:40:23,249 app INFO     Received an authorisation packet from <MAC_ADDR>
2023-09-05 05:40:23,250 app INFO     Authorisation successful from <MAC_ADDR>
2023-09-05 05:40:23,252 app INFO     Syncing door <MAC_ADDR>
2023-09-05 05:40:23,253 app INFO     Updating update_door_locked_out for door <MAC_ADDR>
2023-09-05 05:40:23,256 app INFO     Got message from door (2): {'command': 'ip_address', 'ip_address': '192.168.x.xxx'}
2023-09-05 05:40:33,192 app INFO     Got message from door (2): {'command': 'ping'}
2023-09-05 05:40:43,144 app INFO     Got message from door (2): {'command': 'ping'}
<QuerySet []>
2023-09-05 05:40:52,560 app INFO     Sending door bump to channels for door_<MAC_ADDR>
2023-09-05 05:40:52,561 app INFO     Sending door bump for <MAC_ADDR>
Sending door bump for <MAC_ADDR>
2023-09-05 05:40:56,984 app INFO     Sending door reboot to channels for door_<MAC_ADDR>
2023-09-05 05:40:56,987 app INFO     Rebooting door for <MAC_ADDR>
2023-09-05 05:41:03,009 app INFO     Got message from door (2): {'command': 'ping'}
<QuerySet []>
2023-09-05 05:41:08,847 app INFO     Got message from door (2): {'command': 'ping'}
2023-09-05 05:41:18,862 app INFO     Got message from door (2): {'command': 'ping'}

@jabelone
Copy link
Member

jabelone commented Oct 7, 2023

Fixed in a recent commit. :)

@jabelone jabelone closed this Oct 7, 2023
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

Successfully merging this pull request may close these issues.

2 participants