Skip to content

Commit

Permalink
mac address
Browse files Browse the repository at this point in the history
  • Loading branch information
CamDavidsonPilon committed Dec 12, 2023
1 parent 2b82112 commit 0493c8a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions migration_scripts/import_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ fi
# confirm permissions
chmod -R 770 /home/pioreactor/.pioreactor/storage/
chown -R pioreactor:www-data /home/pioreactor/.pioreactor/storage/
chmod g+s /home/pioreactor/.pioreactor/storage/

echo "Done! Rebooting..."

Expand Down
5 changes: 5 additions & 0 deletions pioreactor/background_jobs/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def off(): # functions don't take any arguments, nothing is passed in
"versions": {"datatype": "json", "settable": False},
"voltage_on_pwm_rail": {"datatype": "Voltage", "settable": False},
"ipv4": {"datatype": "string", "settable": False},
"wlan_mac_address": {"datatype": "string", "settable": False},
}
computer_statistics: Optional[dict] = None
led_in_use: bool = False
Expand Down Expand Up @@ -199,7 +200,11 @@ def check_for_network(self) -> None:

self.ipv4 = ipv4

with open("/sys/class/net/wlan0/address", "r") as f:
self.wlan_mac_address = f.read().strip()

self.logger.debug(f"IPv4 address: {self.ipv4}")
self.logger.debug(f"WLAN MAC address: {self.wlan_mac_address}")

def self_checks(self) -> None:
# check active network connection
Expand Down

0 comments on commit 0493c8a

Please sign in to comment.