From 520d1c7702e88b5dc50f44928139d23b56070163 Mon Sep 17 00:00:00 2001 From: Arti Zirk Date: Sun, 3 Nov 2024 17:56:36 +0200 Subject: [PATCH] Actually works --- Makefile | 34 ++++++++++++++++++++++++++++++++++ README.md | 4 ++++ main.py | 4 ++-- 3 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..5e0cf08 --- /dev/null +++ b/Makefile @@ -0,0 +1,34 @@ +#!/bin/bash + +# When this baud does not work, try 115200 +FLASH_BAUD := 500000 + +# Image to flash +FLASH_IMAGE := sumofirmware.bin + +# Try to automatically find the serialport +SERIAL_PORT := $(shell find /dev -iname "tty*usb*") + +all: erase flash delay update reset + +delay: + sleep 3 + +reset: + esptool.py -p $(SERIAL_PORT) --after hard_reset read_mac + +update: + ampy -d 0.5 -p $(SERIAL_PORT) put main.py + +erase: + esptool.py -p $(SERIAL_PORT) -b $(FLASH_BAUD) erase_flash + +image: + esptool.py -p $(SERIAL_PORT) -b $(FLASH_BAUD) read_flash 0x1000 0x250000 sumofirmware.bin + +flash: + esptool.py -p $(SERIAL_PORT) -b $(FLASH_BAUD) write_flash --flash_mode dio 0x1000 $(FLASH_IMAGE) + +serial: + picocom --baud 115200 -q $(SERIAL_PORT) + diff --git a/README.md b/README.md index feb82b8..08455f4 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,6 @@ # Special SumoRobot firmware for usage with the remote Uses UDP packets from remote to the robot instead of BLE or WebSocket + +MicroPython is ESP32 Generic + +* https://micropython.org/download/ESP32_GENERIC/ diff --git a/main.py b/main.py index b5cc711..c7b8241 100644 --- a/main.py +++ b/main.py @@ -25,8 +25,8 @@ ap_if.active(False) wlan = network.WLAN(network.STA_IF) wlan.active(True) wlan.config(dhcp_hostname=HOSTNAME) -#wlan.connect("sumo", "salakala") -wlan.connect("sumo","salakala") +wlan.connect("sumo", "salakala") +#wlan.connect("k-space.ee legacy","") while not wlan.isconnected(): print("Connecting to wifi...")