This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INFO:root:==================== Rover UPS3 Battery Capacity Communications Client Logging Started 08-25-20 08:30:13 | |
INFO:root:08:30:15 - Input: Connected, State: Charging, Voltage: 4.20, Capacity: 100%. Value max17048_soc = 50.39453125 | |
INFO:root:08:30:22 - Input: Connected, State: Charging, Voltage: 4.20, Capacity: 100%. Value max17048_soc = 50.77734375 | |
INFO:root:08:30:28 - Input: Connected, State: Charging, Voltage: 4.20, Capacity: 100%. Value max17048_soc = 50.77734375 | |
INFO:root:08:30:34 - Input: Connected, State: Charging, Voltage: 4.20, Capacity: 100%. Value max17048_soc = 51.16015625 | |
INFO:root:08:30:40 - Input: Connected, State: Charging, Voltage: 4.20, Capacity: 100%. Value max17048_soc = 51.16015625 | |
INFO:root:08:30:46 - Input: Connected, State: Charging, Voltage: 3.80, Capacity: 44%. Value max17048_soc = 51.546875 | |
INFO:root:***** Battery at 41%. Power Disconnected, system will shutdown in 31 minutes! | |
INFO:root:08:30:53 - Input: Disconnected, State: Discharging, Voltage: 3.78, max17048_soc: 51.546875, Ti |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, smbus, time, logging, atexit | |
from datetime import datetime | |
log_file = '/home/rover_logs/rover-battery-log-' + datetime.now().strftime('%m-%d-%y') + '.txt' | |
logging.basicConfig(filename=log_file,level=logging.DEBUG) | |
logging.info('==================== Rover UPS3 Battery Capacity Communications Client Logging Started ' + datetime.now().strftime('%m-%d-%y %H:%M:%S')) | |
BYTE_CONV_ADC_START = 0b10011101 | |
BYTE_CONV_ADC_STOP = 0b00011101 | |
BYTE_WATCHDOG_STOP = 0b10001101 #Stop Watchdog timer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
#app name: rover-server.py | |
from __future__ import division | |
from datetime import datetime | |
import time, curses | |
import PiMotor | |
import gimbal | |
import subprocess | |
import os, sys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# gimbal-client.py is the Rover client app to receive commands from Remote and respond with ACK/WAK | |
## attribution: https://realpython.com/python-sockets/ | |
from __future__ import division | |
from Raspi_PWM_Servo_Driver import PWM | |
from datetime import datetime, timedelta | |
import sys, socket, selectors, traceback, time, atexit, logging | |
import configparser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# rover-client.py is the Rover client app to receive ping from Remote and respond with ACK | |
import sys, socket, selectors, traceback, time | |
import rover_libclient | |
from datetime import datetime | |
sel = selectors.DefaultSelector() | |
# Connection startup - Socket and Message Object Creation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# rover_libclient.py is the REMOTE socket library and Message class | |
import sys, selectors, json, struct | |
class Message: | |
def __init__(self, selector, sock, addr, name, request): | |
self.selector = selector | |
self.sock = sock | |
self.addr = addr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
"""Server for multithreaded (asynchronous) chat application.""" | |
from socket import AF_INET, socket, SOCK_STREAM, SOL_SOCKET, SO_REUSEADDR | |
from threading import Thread | |
from datetime import datetime | |
import logging, atexit, time | |
log_file = '/home/rover_logs/comm_server-log-' + datetime.now().strftime("%m-%d-%y") + '.txt' | |
logging.basicConfig(filename=log_file,level=logging.DEBUG) | |
logging.info('===== Rover Gimbal Communications Server Logging Started ' + datetime.now().strftime("%m-%d-%y %H:%M:%S")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
HCIATTACH=/usr/bin/hciattach | |
if grep -q "Pi 4" /proc/device-tree/model; then | |
BDADDR= | |
else | |
SERIAL=`cat /proc/device-tree/serial-number | cut -c9-` | |
B1=`echo $SERIAL | cut -c3-4` | |
B2=`echo $SERIAL | cut -c5-6` | |
B3=`echo $SERIAL | cut -c7-8` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import glob | |
import os | |
#os.environ['KIVY_GRAPHICS'] = 'gles' | |
#os.environ['KIVY_WINDOW'] = 'sdl2' | |
from datetime import datetime | |
import time, sys, signal | |
import atexit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Uncomment some or all of these to enable the optional hardware interfaces | |
# Params: | |
# i2c_arm Set to "on" to enable the ARM's i2c interface | |
# (default "off") | |
# i2c_vc Set to "on" to enable the i2c interface | |
# usually reserved for the VideoCore processor | |
# (default "off") | |
# i2c_arm_baudrate Set the baudrate of the ARM's i2c interface | |
# (default "100000") | |
# i2c_vc_baudrate Set the baudrate of the VideoCore i2c interface |
NewerOlder