ofi:vscode-ev3

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
ofi:vscode-ev3 [2022/07/08 15:12]
Ivo Blöchliger
ofi:vscode-ev3 [2023/02/17 15:34] (current)
Ivo Blöchliger
Line 1: Line 1:
 ====== Native Python auf EV3 mit VSCode ====== ====== Native Python auf EV3 mit VSCode ======
   * https://education.lego.com/en-us/product-resources/mindstorms-ev3/teacher-resources/python-for-ev3   * https://education.lego.com/en-us/product-resources/mindstorms-ev3/teacher-resources/python-for-ev3
-  * SSH: user robot, pass maker+  * SSH: user robot, password maker
     * hostnamectl set-hostname LEGO12     * hostnamectl set-hostname LEGO12
 +    * WiFi-Daten in var/lib/connman
   * https://docs.pybricks.com/en/stable/   * https://docs.pybricks.com/en/stable/
   * Use ''dd'' with the ''conv=sparse'' option. It will seek instead of write. Exactly what we need ;-)   * Use ''dd'' with the ''conv=sparse'' option. It will seek instead of write. Exactly what we need ;-)
 + 
 +/etc/wpa_supplicant/wpa_supplicant.conf
 +<code txt wpa_suplicant>
 +#ctrl_interface=/var/run/wpa_supplicant
 +#ctrl_interface_group=benutzergruppe
 +# Die Gruppe muss natürlich angepasst werden
 +eapol_version=1
 +# 0: Der Treiber des Interfaces kümmert sich um das Scannen von Netzen und die AP-Auswahl.
 +#    Dieser Modus sollte benutzt werden, wenn man eine Verschlüsselung auf ein Kabelnetzwerk legt.
 +# 1: wpa_supplicant kümmert sich um das Scannen von Netzen und die AP-Auswahl.
 +# 2: Fast wie 0, es wird aber mit Hilfe von Sicherheitsrichtlinien und der SSID zu APs verbunden (BSSID wird nicht unterstützt)
 +#
 +# Normalerweise funktioniert entweder Modus 1 oder Modus 2.
 +ap_scan=1
 +
 +network={
 +        ssid="tech-lab"
 +        scan_ssid=1
 +        psk="tech-lab"
 +}
 +
 +</code>
 +
 +Way better than stuff below (also, you could take the image and then zero is out while mounted as loopback, much quicker!)
 +<code ruby>
 +def cmd(c)
 +  puts c
 +  r = `#{c}`
 +  return r
 +end
 +
 +raise "Provide hostname (like LEGO01)" unless $ARGV[0]
 +hostname = $ARGV[0]
 +
 +img = "lego01.img"
 +cmd("losetup -Pf #{img}")
 +dev = cmd("losetup -j #{img}").split(":")[0]
 +
 +p2 = dev+"p2"
 +cmd("mkdir -p p2")
 +cmd("mount #{p2} p2")
 +puts "Writing hostname #{hostname} to image"
 +cmd("echo #{hostname} > p2/etc/hostname")
 +cmd("umount p2")
 +
 +cmd("losetup -d ${dev}")
 +puts "Image is ready. Write it with"
 +puts "dd if=#{img} of=/dev/sdXXXX status=progress bs=1M conv=sparse"
 +
 +</code>
 +
  
 <code bash> <code bash>
  • ofi/vscode-ev3.1657285935.txt.gz
  • Last modified: 2022/07/08 15:12
  • by Ivo Blöchliger