Compare commits
14 Commits
61d77870a0
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
| 5c945e43b5 | |||
| dc3bc85607 | |||
| 0d06a71fca | |||
| 5f9ea8867c | |||
| b42055bd4b | |||
| 7ea7f13e9b | |||
| 9bb1cf2055 | |||
| 151853b1d3 | |||
| 6106c46bd8 | |||
| 5062ada35a | |||
| c2d9fb20d7 | |||
| cadc2b0c6a | |||
| a234275422 | |||
| c67bcdc484 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,5 +1,7 @@
|
||||
# Python
|
||||
__pycache__
|
||||
Pipfile
|
||||
Pipfile.lock
|
||||
|
||||
# CAD
|
||||
*.stl
|
||||
|
||||
18
README.md
18
README.md
@@ -1,7 +1,19 @@
|
||||
# To install on robot
|
||||
|
||||
```
|
||||
git clone <url>
|
||||
cd lewis-crawler/crawler_software/raspberry_pi
|
||||
make install?
|
||||
git clone https://kitsunehosting.net/gitea/Kenwood/lewis-crawler /srv/crawler
|
||||
cd /srv/crawler/crawler_software/raspberry_pi
|
||||
make install
|
||||
```
|
||||
|
||||
# Updating
|
||||
|
||||
```
|
||||
cd /srv/crawler
|
||||
git pull
|
||||
```
|
||||
|
||||
|
||||
# Notes
|
||||
|
||||
[Uart Stuff](https://www.reddit.com/r/raspberry_pi/comments/833qux/binary_file_tranfer_via_uart/)
|
||||
|
||||
5031
crawler_cad/External/Bed_moto.obj
vendored
Normal file
5031
crawler_cad/External/Bed_moto.obj
vendored
Normal file
File diff suppressed because it is too large
Load Diff
BIN
crawler_cad/External/bed_Moto.FCStd
vendored
Normal file
BIN
crawler_cad/External/bed_Moto.FCStd
vendored
Normal file
Binary file not shown.
Binary file not shown.
@@ -5,7 +5,7 @@
|
||||
|
||||
# What board to build for and its core
|
||||
CORE ?= arduino:avr
|
||||
FQBN ?= arduino:avr:nano
|
||||
FQBN ?= arduino:avr:nano:cpu=atmega328old
|
||||
|
||||
# What port to build on
|
||||
ifndef SERIAL_DEV
|
||||
@@ -20,13 +20,13 @@ endif
|
||||
|
||||
all: requirements build upload
|
||||
|
||||
build: crawler_slave.ino
|
||||
build: requirements crawler_slave.ino
|
||||
arduino-cli core install $(CORE)
|
||||
|
||||
arduino-cli compile -b $(FQBN) crawler_slave
|
||||
|
||||
upload:
|
||||
echo "Would install to $(SERIAL_DEV)"
|
||||
upload: requirements crawler_slave.ino
|
||||
arduino-cli upload -b $(FQBN) crawler_slave -p $(SERIAL_DEV)
|
||||
|
||||
requirements:
|
||||
@if [ -e requirements.txt ]; \
|
||||
|
||||
@@ -51,7 +51,9 @@ void receiveEvent(int n) {
|
||||
|
||||
switch(id) {
|
||||
case 1:
|
||||
windowWiperServo.write(val);
|
||||
windowWiperServo.write(val); // Set a val
|
||||
delay(5); // pause for a moment
|
||||
windowWiperServo.detach(); // Detach (stop moving) the servo
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
18
crawler_software/raspberry_pi/Makefile
Normal file
18
crawler_software/raspberry_pi/Makefile
Normal file
@@ -0,0 +1,18 @@
|
||||
# A makefile for installing the robot's python
|
||||
# software and setting it up.
|
||||
#
|
||||
# Requires sudo
|
||||
#
|
||||
# Kitsune Scientific 2021
|
||||
|
||||
all: install
|
||||
|
||||
upload: crawler.service
|
||||
sudo cp crawler.service /etc/systemd/system/crawler.service
|
||||
|
||||
sudo systemctl daemon-reload
|
||||
|
||||
sudo systemctl enable crawler.service
|
||||
sudo systemctl start crawler.service
|
||||
|
||||
sudo systemctl status crawler
|
||||
@@ -0,0 +1,16 @@
|
||||
from PIL import Image
|
||||
import base64
|
||||
|
||||
im = Image.open('still.jpg')
|
||||
|
||||
# using Image.ADAPTIVE to avoid dithering
|
||||
for i in range(8, 0, -1):
|
||||
out = im.convert('P', palette=Image.ADAPTIVE, colors=i)
|
||||
|
||||
out.save(f'out_{i}_bits.png')
|
||||
|
||||
with open(f'out_{i}_bits.png', 'rb') as image_file:
|
||||
encoded_string = base64.a85encode(image_file.read())
|
||||
|
||||
with open(f'out_{i}_bits.txt', 'w') as f:
|
||||
f.write(encoded_string.decode('UTF-8'))
|
||||
@@ -0,0 +1 @@
|
||||
M,6r;%14!\!!!!.8Ou6I!!!)I!!!&X#Qk&,!4s2MScA`m!)Q?g7AGd(zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz!.5pZZiC(+%V8a6Akbu".KBGK#QOi)zdSl>0!!-\'6pXdsSF+-I!<<*"_P$QtD$r"izzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz!!!"D(e?.W!V_LqE<#t=!(fUS7'8jaJc
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
25
crawler_software/raspberry_pi/tests/otp/otp_test.py
Normal file
25
crawler_software/raspberry_pi/tests/otp/otp_test.py
Normal file
@@ -0,0 +1,25 @@
|
||||
from random import randrange
|
||||
import time, pyotp, datetime
|
||||
|
||||
hotp = pyotp.HOTP(pyotp.random_base32())
|
||||
|
||||
success = 0
|
||||
num_tries = 20
|
||||
|
||||
for i in range(0,num_tries):
|
||||
epoch = int(time.time())
|
||||
code = hotp.at(epoch)
|
||||
print('------------------------')
|
||||
print(f'Made a code {code} at {epoch}, sending a simualted instruction')
|
||||
|
||||
waittime = randrange(5)
|
||||
print(f'Instuction will take {waittime} seconds to receive or be recieved')
|
||||
time.sleep(waittime)
|
||||
|
||||
if hotp.verify(code, epoch):
|
||||
print(f'code:{code} verified')
|
||||
success += 1
|
||||
else:
|
||||
print(f'code:{code} expired')
|
||||
|
||||
print(f'Succeded {success} out of {num_tries} tries')
|
||||
Reference in New Issue
Block a user