mbot-project / mbot_sys_utils

Install scripts and utilities for setting up MBot environment on Ubuntu/Debian
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Bugfix/gpio error #7

Closed broderio closed 3 months ago

broderio commented 3 months ago

Fixes issue with mbot-start-network.service exiting with failure.

mbot@mbot-omni-010:~ $ sudo systemctl status mbot-start-network.service 
● mbot-start-network.service - Start MBot Networking
     Loaded: loaded (/etc/systemd/system/mbot-start-network.service; enabled; preset: enabled)
     Active: active (exited) since Wed 2024-08-21 11:55:16 EDT; 6min ago
   Main PID: 5846 (code=exited, status=0/SUCCESS)
        CPU: 395ms

Aug 21 11:55:15 mbot-omni-010 sudo[5885]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=0)
Aug 21 11:55:15 mbot-omni-010 sudo[5885]: pam_unix(sudo:session): session closed for user root
Aug 21 11:55:15 mbot-omni-010 sudo[5888]:     root : PWD=/ ; USER=root ; COMMAND=/usr/bin/pinctrl set 4 dh
Aug 21 11:55:15 mbot-omni-010 sudo[5888]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=0)
Aug 21 11:55:15 mbot-omni-010 sudo[5888]: pam_unix(sudo:session): session closed for user root
Aug 21 11:55:15 mbot-omni-010 sudo[5891]:     root : PWD=/ ; USER=root ; COMMAND=/usr/bin/pinctrl set 17 dh
Aug 21 11:55:15 mbot-omni-010 sudo[5891]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=0)
Aug 21 11:55:15 mbot-omni-010 sudo[5891]: pam_unix(sudo:session): session closed for user root
Aug 21 11:55:15 mbot-omni-010 mbot_start_networking.py[5846]: Detected Raspberry Pi 4
Aug 21 11:55:16 mbot-omni-010 systemd[1]: Finished mbot-start-network.service - Start MBot Networking.
broderio commented 3 months ago

I think that mbot_start_networking.py could be converted into a bash script. All the file is doing is making system calls.

I also think that the gpio setup that is included in mbot_start_networking.py should be moved to a separate script since it has nothing to do with the actual networking setup.

broderio commented 3 months ago

I added a commit that converts mbot_start_networking.py to a bash script. I used ChatGPT to do this and I tested it on the Raspberry Pi 4 with Debian 12 bookworm. It seems to work, but I'd like to test its ability to connect to a home wifi and host the access point in the absence of MWireless.

broderio commented 3 months ago

I added another commit that fixes the bug that was preventing the shell script from running on the Raspberry Pi 5.

broderio commented 3 months ago

Works on Raspberry Pi 4 with Debian 12 Bookworm 👍

broderio commented 3 months ago

I added a commit that fixes the issue with Raspberry Pi 4 on Debian 12 unable to connect to home wifi.

janapavlasek commented 3 months ago

Works for me on home wifi and access point for Pi 4 and Pi 5!

janapavlasek commented 3 months ago

Fixes #6