Close

Log 1: A Great Start

A project log for Swarmesh NYU Shanghai

Scalable swarm robot platform using ESP32 MESH capabilities and custom IR location

zander-maoZander Mao 05/03/2019 at 16:180 Comments

Tonight has been a very productive night. We set up our working space, gathered the materials we need, started tinkering with ESP32 and set up the test circuit for IR trasmitters/receivers.  Although there's still a long way to go to achieve our goal, at least we are making progress.


Several things we did:

1. Set up our storage room

We cleaned up a room, move some of Rudi's robotics material and some other useful stuff (capacitors, resistors, and even an old computer!) to the storage room.

Thomas moving the shelf
Rudi and Sheldon check what's available

Our discoveries

2. Set up ESP-IDF


It took us a long time to set things up, but eventually Sheldon, Alison and James all can upload examples to ESP-IDF. That's a great start.

ESP32 running hello_world example

3. Set up IR testing

We set up the circuit to test how IR receiver/trasmitter work. We read the analog output of the IR receiver using an Arduino and used ESP32 as a power (no special reason, just because it's there). For now it doesn't work very well, but we'll try to improve that later.

Prototyping IR test

Circuit Provided by Rudi

Preliminary Result, We read something, but not sensitive enough

Test Plaform. IR receivers/trasmitters are glued to the plastic pieces.


Takeaways:

Basic Linux Command:

ls: list all the file under current directory

cd /children/path: change directory to childern path

cd: go home

cd .. : go back to the parent folder

cp -r /file/you/copy /where/you/want/to/put : -r is a flag indicating recursive, meaning recursively copy every file and every subfolder in the directory you copied.

chmod (*number) /directory: change users' permission to modify a file. Usually there are three numbers, which stands for the permission for the file owner, group and others. Translated in binary, each of the numbers corresponds to the status for three different kinds of permission: read(r), write(w), execute(x). For example, if I set some folder by typing chmod 777 /folder/path, it will be for file owner, group and others, the permission will be 111 (7's binary representation), which means they will be able to read, write and execute the file. If I set them to 444, all of them will only have the permision of 100(4's binary reprpesentation), which means they can only read.

export IDF_PATH=/your/idf/path: set IDF_PATH

mkdir: make directory

cat: peek into file

ESP-IDF configuration:

1. clone from https://github.com/espressif/esp-idf.git

2. set IDF_PATH to where you cloned the project : export IDF_PATH=your/path/to/esp/esp-idf

3. add tool chain path to the PATH variable: export PATH=your/path/to/esp/xtensa-esp32-elf/bin:$PATH

4. Go to project folder, use make menuconfig to set up ports to upload. By default it's ttyUSB0, but on Mac it might be ttyUSBtoUART (something like that). The chip uses a silcon lab CP2102 chip to handle serial communication, so probably a driver for that is needed.

One more thing about ESP32:

It has analog output (PWM) when using Arduino IDE. For simplicity, we will  explore that way of programming.

TODOs:

1. Improve IR distance test

2. Look into VSCode plugin "PlatformIO IDE" and try to simplify the steps to connect.

Discussions