Remote hands-on CubeSat / remote embedded programming workshop

Just presented a remote hands-on workshop on the 1st International Seminar on Astronomy and Astronautics – MCTI (DAY 5). Recording is available here (https://www.youtube.com/watch?v=Sj8oWiK2N3U). Remote participants were able to use BIPES to remotely program, monitor and control ESP8266 boards to read sensors and print messages to LED Matrix displays and see all happening online using a web camera.

Workshop details:

https://obsat.org.br/OficinaCubeSat/

Photos above show 5 ESP8266 boards remotely programmed using BIPES. Five different remote participants were able to control the LED Matrices and the setup with a camera pointing to the boards:

d

Thank for the invitation and opportunity, minister of science, technology and innovation!

Posted in Uncategorized | Leave a comment

Reset trouble with ESP8266 and MicroPython

While preparing boards for a workshop, I got some WeMos D1 mini (ESP8266) modules that continuously reset just after MicroPython boot. Here’s how I flashed them and how I fixed:

To flash MicroPython:
esptool.py –port /dev/ttyUSB0 erase_flash

esptool.py –port /dev/ttyUSB0 –baud 115200 write_flash –flash_size=detect -fm dio 0 esp8266-20210418-v1.15.bin

After resetting, the board continuously resets. The problem is a power issue related to MicroPython when it started its default Access Point.

To fix the problem, simple disable the AP mode just after the board boots:

minicom -b 115200 -D /dev/ttyUSB0

import network; network.WLAN(network.AP_IF).active(False)

The commands above should fix the issue. Then you can connect to an existing Access Point:
import network
sta_if = network.WLAN(network.STA_IF); sta_if.active(True)
sta_if.connect("<**>", "<**>")
print(sta_if.isconnected())

Helpful link:
https://forum.micropython.org/viewtopic.php?f=16&t=9046

Posted in Uncategorized | Leave a comment

Playing with 3D printed CubeSats ;-)

Playing with experimental 3D Printed CubeSats powered by Arduino and Raspberry Pi Boards!

https://www.thingiverse.com/make:939675

Posted in Uncategorized | Leave a comment

On Line Prize Draw

A friend / partner needed an online Prize Draw application to select a random participant to give a gift during the live event on youtube. He asked for help, and wanted that participants provided some information to participate, and did not want free tools with ads.

So I wrote this simple Online Prize Draw web app using HTML, PHP, JavaScript and MySQL.

The source code is here:
https://github.com/rafaelaroca/OnlinePrizeDraw

Usage:
1. Participants must access a link and provide their details, such as name, phone and email
2. The host accesses a page that runs the prize draw
3. All participants area available on the database and the list can be exported to Excel

Posted in Uncategorized | Leave a comment

BIPES Maps – Geographical Information System integrated with BIPES

Some BIPES (www.bipes.net.br) users requested a map feature, allowing sensors to be seen on a map, with real time updates or even moving objects / vehicles on the map controlled from BIPES HTTP Web Requests.

In that way, we have built a simple, yet functional Geographic Information system for BIPES.

Source code is here:
https://github.com/rafaelaroca/bipes_maps/

How to use:
https://bipes.net.br/map/doc.html

Usage example:
1. Define a session ID, and make sure this session is clear for you.

https://bipes.net.br/map/clearSession.php?session=1763

2. Open the map with your session ID

https://bipes.net.br/map/main.php?session=1763

3. Manage the map as you prefer using this interactive interface to create / edit / delete / update markers:

https://bipes.net.br/map/crud/index.php/main/static

https://bipes.net.br/map/crud/index.php/main/dynamic

4. Use our webservices so that your application can update the map:

https://bipes.net.br/map/doc.html

For example, if you want to add a marker to the map:

Icon used:
https://image.flaticon.com/icons/png/512/2540/2540201.png

https://bipes.net.br/map/addMarker.php?name=MyIcon1&lat=-20&long=-44&session=1763&info=SensorInfo1&icon=https://image.flaticon.com/icons/png/512/2540/2540201.png

Add the same icon in another position

https://bipes.net.br/map/addMarker.php?name=MyIcon2&lat=-21&long=-41&session=1763&info=SensorInfo2&icon=https://image.flaticon.com/icons/png/512/2540/2540201.png

Add the same icon in another position, again!

https://bipes.net.br/map/addMarker.php?name=MyIcon3&lat=-11&long=-44&session=1763&info=SensorInfo3&icon=https://image.flaticon.com/icons/png/512/2540/2540201.png

The markers will automatically show on the map!

Now you can also move these markers with updatePosition or change data! Use BIPES HTTP GET Block to interact / control the map!

Happy BIPEing 😉

Posted in Uncategorized | Leave a comment

1st Brazilian Satellite Olympiad has 352 teams!

Registration for the 1st MCTI Brazilian Satellite Olympiad is now closed. We had more than 1500 registered participants divided over 23 Brazilian states on 352 teams.

The list of participants registered for the 1st Brazilian MCTI Satellite Olympics is now available here: https://obsat.org.br/inscricoes/lista.html#

More details about the olympiad: http://obsat.org.br/

Teams enrolled for the 1st Brazilian Satellite Olympiad (www.obsat.org.br)

Posted in Uncategorized | Leave a comment

Another Feynman quote

“Tell your son to stop trying to fill your head with science — for to fill your heart with love is enough. ”
― Richard Feynman

Source:
BBC – The Fantastic Mr Feynman

(very good documentary!)

https://www.youtube.com/watch?v=H9fjhQMsDW4

Posted in Uncategorized | Leave a comment

BIPES meets SAP

SAP company provides Enterprise Resource Planning and other corporate software widely used all over the world in companies of all sizes and types. Today, I found an article on SAP Blogs from Gunter Albrecht describing / showing how he quickly developed an IoT application using BIPES and integrated it with SAP Business Technology Platform (SAP BTP).

He used an ESP32 board, a temperature/moisture sensor and created a block based program on BIPES to send these sensor readings to SAP BTP using secure MQTT connection!

Thank you Gunter for trying BIPES and integrating it with SAP BTP, even for a quick test. We were happy and proud!

No-Code IoT and SAP IoT services for SAP BTP

https://blogs.sap.com/2021/03/21/no-code-iot-and-sap-iot-services-for-sap-btp/

Posted in Uncategorized | Leave a comment

Feynman

“You cannot get educated by this self-propagating system in which people study to pass exams, and teach others to pass exams, but nobody knows anything. You learn something by doing it yourself, by asking questions, by thinking, and by experimenting.”

— Richard Feynman

feynman
Posted in Uncategorized | Leave a comment

Studying MicroPython’s Serial REPL

The beauty of Unix philosophy: piping data from one simple program to another, to do great work 😉

Sniffing the serial port to know better MicroPython Serial REPL (https://docs.micropython.org/en/latest/reference/repl.html) protocol:

echo 123 > test.txt
strace -s9999 -o output.log -eread,write ampy -p /dev/ttyACM put test.txt

Result:
read(9, “123\n”, 4096) = 4
read(9, “”, 4096) = 0
write(3, “\r\3\3”, 3) = 3
write(3, “\r\1”, 2) = 2
read(3, “\r”, 1) = 1
read(3, “\n”, 1) = 1
read(3, “>”, 1) = 1
read(3, “>”, 1) = 1
read(3, “>”, 1) = 1
read(3, ” “, 1) = 1
read(3, “\r”, 1) = 1
read(3, “\n”, 1) = 1
read(3, “>”, 1) = 1
read(3, “>”, 1) = 1
read(3, “>”, 1) = 1
read(3, ” “, 1) = 1
read(3, “\r”, 1) = 1
read(3, “\n”, 1) = 1
read(3, “>”, 1) = 1
read(3, “>”, 1) = 1
read(3, “>”, 1) = 1
read(3, ” “, 1) = 1
read(3, “\r”, 1) = 1
read(3, “\n”, 1) = 1
read(3, “>”, 1) = 1
read(3, “>”, 1) = 1
read(3, “>”, 1) = 1
read(3, ” “, 1) = 1
read(3, “\r”, 1) = 1
read(3, “\n”, 1) = 1
read(3, “r”, 1) = 1
read(3, “a”, 1) = 1
read(3, “w”, 1) = 1
read(3, ” “, 1) = 1
read(3, “R”, 1) = 1
read(3, “E”, 1) = 1
read(3, “P”, 1) = 1
read(3, “L”, 1) = 1
read(3, “;”, 1) = 1
read(3, ” “, 1) = 1
read(3, “C”, 1) = 1
read(3, “T”, 1) = 1
read(3, “R”, 1) = 1
read(3, “L”, 1) = 1
read(3, “-“, 1) = 1
read(3, “B”, 1) = 1
read(3, ” “, 1) = 1
read(3, “t”, 1) = 1
read(3, “o”, 1) = 1
read(3, ” “, 1) = 1
read(3, “e”, 1) = 1
read(3, “x”, 1) = 1
read(3, “i”, 1) = 1
read(3, “t”, 1) = 1
read(3, “\r”, 1) = 1
read(3, “\n”, 1) = 1
read(3, “>”, 1) = 1
write(3, “\4”, 1) = 1
read(3, “O”, 1) = 1
read(3, “K”, 1) = 1
read(3, “\r”, 1) = 1
read(3, “\n”, 1) = 1
read(3, “M”, 1) = 1
read(3, “P”, 1) = 1
read(3, “Y”, 1) = 1
read(3, “:”, 1) = 1
read(3, ” “, 1) = 1
read(3, “s”, 1) = 1
read(3, “o”, 1) = 1
read(3, “f”, 1) = 1
read(3, “t”, 1) = 1
read(3, ” “, 1) = 1
read(3, “r”, 1) = 1
read(3, “e”, 1) = 1
read(3, “b”, 1) = 1
read(3, “o”, 1) = 1
read(3, “o”, 1) = 1
read(3, “t”, 1) = 1
read(3, “\r”, 1) = 1
read(3, “\n”, 1) = 1
write(3, “\3”, 1) = 1
write(3, “\3”, 1) = 1
read(3, “r”, 1) = 1
read(3, “a”, 1) = 1
read(3, “w”, 1) = 1
read(3, ” “, 1) = 1
read(3, “R”, 1) = 1
read(3, “E”, 1) = 1
read(3, “P”, 1) = 1
read(3, “L”, 1) = 1
read(3, “;”, 1) = 1
read(3, ” “, 1) = 1
read(3, “C”, 1) = 1
read(3, “T”, 1) = 1
read(3, “R”, 1) = 1
read(3, “L”, 1) = 1
read(3, “-“, 1) = 1
read(3, “B”, 1) = 1
read(3, ” “, 1) = 1
read(3, “t”, 1) = 1
read(3, “o”, 1) = 1
read(3, ” “, 1) = 1
read(3, “e”, 1) = 1
read(3, “x”, 1) = 1
read(3, “i”, 1) = 1
read(3, “t”, 1) = 1
read(3, “\r”, 1) = 1
read(3, “\n”, 1) = 1
read(3, “>”, 1) = 1
write(3, “f = open(‘test.txt’, ‘wb’)”, 26) = 26
write(3, “\4”, 1) = 1
read(3, “OK”, 2) = 2
read(3, “\4”, 1) = 1
read(3, “\4”, 1) = 1
read(3, “>”, 1) = 1
write(3, “f.write(b’123\\n’)”, 17) = 17
write(3, “\4”, 1) = 1
read(3, “OK”, 2) = 2
read(3, “\4”, 1) = 1
read(3, “\4”, 1) = 1
read(3, “>”, 1) = 1
write(3, “f.close()”, 9) = 9
write(3, “\4”, 1) = 1
read(3, “OK”, 2) = 2
read(3, “\4”, 1) = 1
read(3, “\4”, 1) = 1
write(3, “\r\2”, 2) = 2
+++ exited with 0 +++

strace -s9999 -o output.log -eread,write ampy -p /dev/ttyACM1 ls

Result:
write(3, “\r\3\3”, 3) = 3
write(3, “\r\1”, 2) = 2
read(3, “\r”, 1) = 1
read(3, “\n”, 1) = 1
read(3, “>”, 1) = 1
read(3, “>”, 1) = 1
read(3, “>”, 1) = 1
read(3, ” “, 1) = 1
read(3, “\r”, 1) = 1
read(3, “\n”, 1) = 1
read(3, “>”, 1) = 1
read(3, “>”, 1) = 1
read(3, “>”, 1) = 1
read(3, ” “, 1) = 1
read(3, “\r”, 1) = 1
read(3, “\n”, 1) = 1
read(3, “>”, 1) = 1
read(3, “>”, 1) = 1
read(3, “>”, 1) = 1
read(3, ” “, 1) = 1
read(3, “\r”, 1) = 1
read(3, “\n”, 1) = 1
read(3, “>”, 1) = 1
read(3, “>”, 1) = 1
read(3, “>”, 1) = 1
read(3, ” “, 1) = 1
read(3, “\r”, 1) = 1
read(3, “\n”, 1) = 1
read(3, “r”, 1) = 1
read(3, “a”, 1) = 1
read(3, “w”, 1) = 1
read(3, ” “, 1) = 1
read(3, “R”, 1) = 1
read(3, “E”, 1) = 1
read(3, “P”, 1) = 1
read(3, “L”, 1) = 1
read(3, “;”, 1) = 1
read(3, ” “, 1) = 1
read(3, “C”, 1) = 1
read(3, “T”, 1) = 1
read(3, “R”, 1) = 1
read(3, “L”, 1) = 1
read(3, “-“, 1) = 1
read(3, “B”, 1) = 1
read(3, ” “, 1) = 1
read(3, “t”, 1) = 1
read(3, “o”, 1) = 1
read(3, ” “, 1) = 1
read(3, “e”, 1) = 1
read(3, “x”, 1) = 1
read(3, “i”, 1) = 1
read(3, “t”, 1) = 1
read(3, “\r”, 1) = 1
read(3, “\n”, 1) = 1
read(3, “>”, 1) = 1
write(3, “\4”, 1) = 1
read(3, “O”, 1) = 1
read(3, “K”, 1) = 1
read(3, “\r”, 1) = 1
read(3, “\n”, 1) = 1
read(3, “M”, 1) = 1
read(3, “P”, 1) = 1
read(3, “Y”, 1) = 1
read(3, “:”, 1) = 1
read(3, ” “, 1) = 1
read(3, “s”, 1) = 1
read(3, “o”, 1) = 1
read(3, “f”, 1) = 1
read(3, “t”, 1) = 1
read(3, ” “, 1) = 1
read(3, “r”, 1) = 1
read(3, “e”, 1) = 1
read(3, “b”, 1) = 1
read(3, “o”, 1) = 1
read(3, “o”, 1) = 1
read(3, “t”, 1) = 1
read(3, “\r”, 1) = 1
read(3, “\n”, 1) = 1
write(3, “\3”, 1) = 1
write(3, “\3”, 1) = 1
read(3, “r”, 1) = 1
read(3, “a”, 1) = 1
read(3, “w”, 1) = 1
read(3, ” “, 1) = 1
read(3, “R”, 1) = 1
read(3, “E”, 1) = 1
read(3, “P”, 1) = 1
read(3, “L”, 1) = 1
read(3, “;”, 1) = 1
read(3, ” “, 1) = 1
read(3, “C”, 1) = 1
read(3, “T”, 1) = 1
read(3, “R”, 1) = 1
read(3, “L”, 1) = 1
read(3, “-“, 1) = 1
read(3, “B”, 1) = 1
read(3, ” “, 1) = 1
read(3, “t”, 1) = 1
read(3, “o”, 1) = 1
read(3, ” “, 1) = 1
read(3, “e”, 1) = 1
read(3, “x”, 1) = 1
read(3, “i”, 1) = 1
read(3, “t”, 1) = 1
read(3, “\r”, 1) = 1
read(3, “\n”, 1) = 1
read(3, “>”, 1) = 1
write(3, “try: \n import os\nexcept ImportError:\n import uos as os\ndef listdir(directory):\n if directory == ‘/’: \n return sorted([directory + f for f in os.listdir(directory)])\n else:\n return sorted([directory + ‘/’ + f “, 256) = 256
write(3, “for f in os.listdir(directory)])\n\nprint(listdir(‘/’))\n”, 54) = 54
write(3, “\4”, 1) = 1
read(3, “OK”, 2) = 2
read(3, “[“, 1)                         = 1
read(3, “‘”, 1)                         = 1
read(3, “/”, 1)                         = 1
read(3, “f”, 1)                         = 1
read(3, “i”, 1)                         = 1
read(3, “l”, 1)                         = 1
read(3, “e”, 1)                         = 1
read(3, “.”, 1)                         = 1
read(3, “t”, 1)                         = 1
read(3, “x”, 1)                         = 1
read(3, “t”, 1)                         = 1
read(3, “‘”, 1)                         = 1
read(3, “,”, 1)                         = 1
read(3, ” “, 1)                         = 1
read(3, “‘”, 1)                         = 1
read(3, “/”, 1)                         = 1
read(3, “t”, 1)                         = 1
read(3, “e”, 1)                         = 1
read(3, “s”, 1)                         = 1
read(3, “t”, 1)                         = 1
read(3, “.”, 1)                         = 1
read(3, “t”, 1)                         = 1
read(3, “x”, 1)                         = 1
read(3, “t”, 1)                         = 1
read(3, “‘”, 1)                         = 1
read(3, “,”, 1)                         = 1
read(3, ” “, 1)                         = 1
read(3, “‘”, 1)                         = 1
read(3, “/”, 1)                         = 1
read(3, “t”, 1)                         = 1
read(3, “e”, 1)                         = 1
read(3, “s”, 1)                         = 1
read(3, “t”, 1)                         = 1
read(3, “1”, 1)                         = 1
read(3, “.”, 1)                         = 1
read(3, “t”, 1)                         = 1
read(3, “x”, 1)                         = 1
read(3, “t”, 1)                         = 1
read(3, “‘”, 1)                         = 1
read(3, “]”, 1) = 1
read(3, “\r”, 1) = 1
read(3, “\n”, 1) = 1
read(3, “\4”, 1) = 1
read(3, “\4”, 1) = 1
write(3, “\r\2”, 2) = 2
write(1, “/file.txt\n”, 10) = 10
write(1, “/test.txt\n”, 10) = 10
write(1, “/test1.txt\n”, 11) = 11
+++ exited with 0 +++

strace -s9999 -o output.log -eread,write ampy -p /dev/ttyACM1 get test.txt

Result:
write(3, “\r\3\3”, 3) = 3
write(3, “\r\1”, 2) = 2
read(3, “\r”, 1) = 1
read(3, “\n”, 1) = 1
read(3, “>”, 1) = 1
read(3, “>”, 1) = 1
read(3, “>”, 1) = 1
read(3, ” “, 1) = 1
read(3, “\r”, 1) = 1
read(3, “\n”, 1) = 1
read(3, “>”, 1) = 1
read(3, “>”, 1) = 1
read(3, “>”, 1) = 1
read(3, ” “, 1) = 1
read(3, “\r”, 1) = 1
read(3, “\n”, 1) = 1
read(3, “>”, 1) = 1
read(3, “>”, 1) = 1
read(3, “>”, 1) = 1
read(3, ” “, 1) = 1
read(3, “\r”, 1) = 1
read(3, “\n”, 1) = 1
read(3, “>”, 1) = 1
read(3, “>”, 1) = 1
read(3, “>”, 1) = 1
read(3, ” “, 1) = 1
read(3, “\r”, 1) = 1
read(3, “\n”, 1) = 1
read(3, “r”, 1) = 1
read(3, “a”, 1) = 1
read(3, “w”, 1) = 1
read(3, ” “, 1) = 1
read(3, “R”, 1) = 1
read(3, “E”, 1) = 1
read(3, “P”, 1) = 1
read(3, “L”, 1) = 1
read(3, “;”, 1) = 1
read(3, ” “, 1) = 1
read(3, “C”, 1) = 1
read(3, “T”, 1) = 1
read(3, “R”, 1) = 1
read(3, “L”, 1) = 1
read(3, “-“, 1) = 1
read(3, “B”, 1) = 1
read(3, ” “, 1) = 1
read(3, “t”, 1) = 1
read(3, “o”, 1) = 1
read(3, ” “, 1) = 1
read(3, “e”, 1) = 1
read(3, “x”, 1) = 1
read(3, “i”, 1) = 1
read(3, “t”, 1) = 1
read(3, “\r”, 1) = 1
read(3, “\n”, 1) = 1
read(3, “>”, 1) = 1
write(3, “\4”, 1) = 1
read(3, “O”, 1) = 1
read(3, “K”, 1) = 1
read(3, “\r”, 1) = 1
read(3, “\n”, 1) = 1
read(3, “M”, 1) = 1
read(3, “P”, 1) = 1
read(3, “Y”, 1) = 1
read(3, “:”, 1) = 1
read(3, ” “, 1) = 1
read(3, “s”, 1) = 1
read(3, “o”, 1) = 1
read(3, “f”, 1) = 1
read(3, “t”, 1) = 1
read(3, ” “, 1) = 1
read(3, “r”, 1) = 1
read(3, “e”, 1) = 1
read(3, “b”, 1) = 1
read(3, “o”, 1) = 1
read(3, “o”, 1) = 1
read(3, “t”, 1) = 1
read(3, “\r”, 1) = 1
read(3, “\n”, 1) = 1
write(3, “\3”, 1) = 1
write(3, “\3”, 1) = 1
read(3, “r”, 1) = 1
read(3, “a”, 1) = 1
read(3, “w”, 1) = 1
read(3, ” “, 1) = 1
read(3, “R”, 1) = 1
read(3, “E”, 1) = 1
read(3, “P”, 1) = 1
read(3, “L”, 1) = 1
read(3, “;”, 1) = 1
read(3, ” “, 1) = 1
read(3, “C”, 1) = 1
read(3, “T”, 1) = 1
read(3, “R”, 1) = 1
read(3, “L”, 1) = 1
read(3, “-“, 1) = 1
read(3, “B”, 1) = 1
read(3, ” “, 1) = 1
read(3, “t”, 1) = 1
read(3, “o”, 1) = 1
read(3, ” “, 1) = 1
read(3, “e”, 1) = 1
read(3, “x”, 1) = 1
read(3, “i”, 1) = 1
read(3, “t”, 1) = 1
read(3, “\r”, 1) = 1
read(3, “\n”, 1) = 1
read(3, “>”, 1) = 1
write(3, “\nimport sys\nwith open(‘test.txt’, ‘rb’) as infile:\n while True:\n result = infile.read(32)\n if result == b”:\n break\n len = sys.stdout.write(result)\n”, 183) = 183
write(3, “\4”, 1) = 1
read(3, “OK”, 2) = 2
read(3, “1”, 1) = 1
read(3, “2”, 1) = 1
read(3, “3”, 1) = 1
read(3, “\r”, 1) = 1
read(3, “\n”, 1) = 1
read(3, “\4”, 1) = 1
read(3, “\4”, 1) = 1
write(3, “\r\2”, 2) = 2
write(1, “123\r\n”, 5) = 5
write(1, “\n”, 1) = 1
+++ exited with 0 +++

Optional:
-eread,write,ioctl

First, useful codes:
(http://www.physics.udel.edu/~watson/scen103/ascii.html)
Decimal | Ctrl char
1 | Ctrl+A
2 | Ctrl+B
3 | Ctrl+C
4 | Ctrl+D
5 | Ctrl+E

Some common conclusions (for the 3 tested cases):
1. Send Ctrl+C (3) twice
2. Send Ctrl+A (1) once
3. Wait for the message “raw REPL; CTRL-B to exit”
4. Send Ctrl+D (4)
5. Wait for “MPY: soft reboot”
6. Send Ctrl+C (3) twice again
7. Wait for the message “raw REPL; CTRL-B to exit”

8. Send the command / file, followed by Ctrl+D (4)
9. Repeat 8 as needed
10. To finish, send \r followed by Ctrl+B (2)

Posted in Uncategorized | Leave a comment