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

Doorbot2 is not responding to fobs #1139

Open
johnmckerrell opened this issue May 22, 2019 · 12 comments

Comments

Projects
None yet
2 participants
@johnmckerrell
Copy link
Member

commented May 22, 2019

Screen is up, fobs are being read (red light shows) but door doesn't open.

@johnmckerrell

This comment has been minimized.

Copy link
Member Author

commented May 22, 2019

The log cards screen wasn't running, reboot fixed things.

@amcewen

This comment has been minimized.

Copy link
Member

commented May 24, 2019

Failed again today. Pi seems up okay but the log cards screen isn't running.

@amcewen amcewen reopened this May 24, 2019

@amcewen

This comment has been minimized.

Copy link
Member

commented May 24, 2019

Have fixed the bug that meant the visits.log wasn't being written to (since the Slack integration got added), in commit DoESLiverpool/logcards@fc8a70f (not fully deployed it yet, but doorbot2 has a manually applied version), but I don't think that's what was causing the issue.

I've modded /lib/systemd/system/logcards.service to add a -L parameter to screen, so it's logging its output to /home/pi/logcards/screenlog.0. That should let us see what's causing screen to exit if/when it happens again. We should remove that once we've worked out the issue...

@johnmckerrell

This comment has been minimized.

Copy link
Member Author

commented May 25, 2019

/var/lib/gems/2.3.0/gems/activesupport-3.2.22.5/lib/active_support/core_ext/kernel/agnostics.rb:7:in ``': Cannot allocate memory - echo 0 > /sys/class/gpio/gpio25/value (Errno::ENOMEM)
        from /var/lib/gems/2.3.0/gems/activesupport-3.2.22.5/lib/active_support/core_ext/kernel/agnostics.rb:7:in ``'
        from logcards.rb:149:in `setDoorState'
        from logcards.rb:434:in `rescue in <main>'
        from logcards.rb:213:in `<main>'

So it seems like it's running out of memory, seems a bit surprising, possibly something isn't being cleaned up when we're spawning the process to open the door. We should perhaps just write to the device to open the door from within ruby instead rather than spawning a shell.

@johnmckerrell

This comment has been minimized.

Copy link
Member Author

commented May 25, 2019

Interestingly soon after a reboot (around the time of the last comment) free -m was reporting:

              total        used        free      shared  buff/cache   available
Mem:            926         158         438          12         328         703
Swap:            99           0          99

But now we get:

              total        used        free      shared  buff/cache   available
Mem:            926         232         358          12         334         629
Swap:            99           0          99

So it does seem like you can see the memory being used up. Again not really sure why it has changed.

I've just stopped the screen and the memory did drop but only to 200M, restarted it now and we're on:

              total        used        free      shared  buff/cache   available
Mem:            926         230         360          12         335         631
Swap:            99           0          99
@johnmckerrell

This comment has been minimized.

Copy link
Member Author

commented May 26, 2019

              total        used        free      shared  buff/cache   available
Mem:            926         840          26           1          58          35
Swap:            99          98           1
@johnmckerrell

This comment has been minimized.

Copy link
Member Author

commented May 26, 2019

Down again, ran out of memory. To be honest it's more likely to be the web browser so I've killed that and we'll see if it lasts better, I'll try to check later. Hm.. although we currently install a very specific version of kweb, so that won't have changed, it would be more likely an issue in X (or it could be the ruby as I originally thought). Killing kweb should give us an indication anyway.

@johnmckerrell

This comment has been minimized.

Copy link
Member Author

commented May 26, 2019

Yeah, seems to be kweb, or something around the screen, as we're only using an additional 10M in a few hours (and in fact it dropped by 1M in the past ten minutes). From this earlier:

              total        used        free      shared  buff/cache   available
Mem:            926         118         563          12         243         744
Swap:            99           0          99

To this now:

              total        used        free      shared  buff/cache   available
Mem:            926         127         548          12         249         735
Swap:            99           0          99
@johnmckerrell

This comment has been minimized.

Copy link
Member Author

commented Jun 8, 2019

I've installed surf and am running it manually, will see if this helps before updating the setup scripts.

@johnmckerrell

This comment has been minimized.

Copy link
Member Author

commented Jun 8, 2019

              total        used        free      shared  buff/cache   available
Mem:            926         193         495          12         237         670
Swap:            99           0          99
@johnmckerrell

This comment has been minimized.

Copy link
Member Author

commented Jun 8, 2019

Does seem like it's going up:

              total        used        free      shared  buff/cache   available
Mem:            926         325         361          12         239         537
Swap:            99           0          99
@johnmckerrell

This comment has been minimized.

Copy link
Member Author

commented Jun 9, 2019

Went off again, same error message as previously:

/var/lib/gems/2.3.0/gems/activesupport-3.2.22.5/lib/active_support/core_ext/kernel/agnostics.rb:7:in ``': Cannot allocate memory - echo 0 > /sys/class/gpio/gpio25/value (Errno::ENOMEM)^M
        from /var/lib/gems/2.3.0/gems/activesupport-3.2.22.5/lib/active_support/core_ext/kernel/agnostics.rb:7:in ``'^M
        from logcards.rb:149:in `setDoorState'^M
        from logcards.rb:434:in `rescue in <main>'^M
        from logcards.rb:213:in `<main>'^M
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.