Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
bnyitrai03 committed Sep 24, 2024
2 parents e8b7e3b + 09399b1 commit 492cc81
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/test_and_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ jobs:

runs-on: ubuntu-latest

env:
WIFI_SSID: ${{ secrets.WIFI_SSID }}
WIFI_PASSWORD: ${{ secrets.WIFI_PASSWORD }}

steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
34 changes: 34 additions & 0 deletions bin/configure_wifi.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash

# configure_wifi.sh

# Ensure the script is run as root
if [ "$EUID" -ne 0 ]; then
echo "Please run as root"
exit
fi

# Check if environment variables are set
if [ -z "$WIFI_SSID" ] || [ -z "$WIFI_PASSWORD" ]; then
echo "Error: WIFI_SSID or WIFI_PASSWORD environment variable is not set"
exit 1
fi

# Create the wpa_supplicant.conf file
cat << EOF > /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US
network={
ssid="$WIFI_SSID"
psk="$WIFI_PASSWORD"
}
EOF

echo "Wi-Fi configuration has been updated."

# Restart the wireless interface
wpa_cli -i wlan0 reconfigure

echo "Wireless interface has been reconfigured."
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

setup(
name='sentinel-mrhat-cam',
version='1.1.7',
version='1.1.8',
description='Testing python code for Starling detection project',
author='Ferenc Nandor Janky, Attila Gombos, Nyiri Levente, Nyitrai Bence',
author_email='[email protected]',
packages=find_packages(),
scripts=['bin/sentinel_mrhat_cam.sh', 'bin/sentinel_mrhat_cam_main.py'],
scripts=['bin/sentinel_mrhat_cam.sh', 'bin/sentinel_mrhat_cam_main.py', 'bin/configure_wifi.sh'],
data_files=[('config', ['config/sentinel_app_config.json', 'config/sentinel_log_config.yaml'])],
install_requires=['picamera2', 'PyYAML', 'pillow', 'pytz', 'paho-mqtt', 'numpy'],
)

0 comments on commit 492cc81

Please sign in to comment.