README.md - brcon2025-hackathons - Bitreichcon 2025 Hackathons
 (HTM) git clone git://bitreich.org/brcon2025-hackathons git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/brcon2025-hackathons
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) Tags
       ---
       README.md (3058B)
       ---
            1 # Seeed farm live at: nc bitreich.org 7000
            2 
            3 Welcome Seeed Farmer!
            4 
            5 Let me show you the way around:
            6 
            7 ```
            8  ((( []  []  [] )))                   .-------.
            9        \  | / _[] )))                 |       |
           10 ((( []__\ |/ /                        |       |
           11       _\\||_/        ((( usb-wifi----/=======/--------bitreich.org
           12      /______/-----------usb-serial--/=======/
           13      '------'                       ======='
           14 
           15 ESP32-C3 boards                Laptop doing SSH port forwarding
           16 Connected on USB HUB
           17 ```
           18 
           19 For you that means visitting bitreich.org on port 7000 and you will
           20 be given one gopher seed! You can use that tool to farm the seed:
           21 
           22 ```
           23 $ sh client.sh
           24 MicroPython df05cae on 2025-07-24; ESP32C3 module with ESP32C3
           25 Type "help()" for more information.
           26 >>>
           27 ```
           28 
           29 That's it fellow farmer! Nature is this generous, you just have to
           30 bow down and put down a seed, you'll see a tree growing!
           31 
           32 ## Programming the farm
           33 
           34 Now you can whisper python runes to the tree, and it might grant
           35 your wishes...
           36 
           37 ```
           38 >>> from network import WLAN
           39 >>> from socket import socket
           40 >>> # Connect to WiFi
           41 >>> # Connect to Internet APIs
           42 ```
           43 
           44 Every seed has an IP address given by DHCP, with a port redirection
           45 done on bitreich.org for it:
           46 
           47 - 192.168.66.3:70 is accessible from bitreich.org:7003
           48 - 192.168.66.4:70 is accessible from bitreich.org:7004
           49 - 192.168.66.5:70 is accessible from bitreich.org:7005
           50 - 192.168.66.6:70 is accessible from bitreich.org:7006
           51 - ...
           52 - 192.168.66.123:70 is accessible from bitreich.org:7123
           53 - 192.168.66.124:70 is accessible from bitreich.org:7124
           54 
           55 In this repo, you will find the scripts that make maintain the farm:
           56 
           57 - forward.sh - to maintain the port forwarding
           58 - server.sh - that runs session.sh on every incoming connection on port :7000
           59 - session.sh - that connects to the seed with python access
           60 - client.sh - that's for you! run this and you can send python commands to the seed
           61 
           62 ## Quick-start on MicroPython seed farming
           63 
           64 The seeds run https://micropython.org/ as a firmware!
           65 
           66 That way you can run python program directly bare-metal: python is your OS!
           67 
           68 There is a `example.py` that shows you how you can connect
           69 to the farm WiFi and get outta here on the world wide gopher.
           70 
           71 Every time you connect to the farm with `client.sh`, you will get a new seed.
           72 It will be completely reset using `machine.reset()` and you'll be having a
           73 fresh new seed to plant!
           74 
           75 The seeds are boards called Xiao ESP32-C3:
           76 https://wiki.seeedstudio.com/XIAO_ESP32C3_Getting_Started/
           77 
           78 Here, you can use this page to understand how WiFi and network
           79 handling works:
           80 https://docs.micropython.org/en/latest/esp32/quickref.html#wlan
           81 
           82 Here, you can lookup the networking functions of MicroPython,
           83 which use the same API as Python:
           84 https://docs.micropython.org/en/latest/library/socket.html
           85 
           86 Here, you can see instructions to run a MicroPython simulator
           87 on your desktop and connect to Internet with it too:
           88 https://github.com/micropython/micropython/tree/master/ports/unix
           89 
           90 You will have a `micropython` program that you can run to test programs
           91 that work just like on the seeds.