Modifications

Sauter à la navigation Sauter à la recherche
3 008 octets ajoutés ,  19 février 2017 à 16:19
Ligne 122 : Ligne 122 :  
{{ambox|text=If you have any trouble connecting over USB using pymakr, make sure you have the proper FTDI drivers installed}}
 
{{ambox|text=If you have any trouble connecting over USB using pymakr, make sure you have the proper FTDI drivers installed}}
    +
== Configuration initiale ==
 +
After installing Pymakr, you need to take a few seconds to configure it for the first time. Please follow these steps:
 +
# Connect your computer to the WiFi network named after your board (e.g. '''lopy-wlan-xxxx''', '''wipy-wlan-xxxx'''). The password is '''www.pycom.io'''
 +
# Open Pymakr.
 +
# In the menu, go to '''Settings > Preferences''' (''Pymakr > Preferences'' on macOS).
 +
# In the left list look for Pycom Device.
 +
# For device, type down '''192.168.4.1'''. The default username and password are '''micro''' and '''python''', respectively.
 +
# Click OK
 +
 +
{{ambox|text=Pymakr also supports wired connections. Instead of typing the IP address, you can click on the combo box arrow and select the proper serial port from the list. Our boards don’t require any username or password for the serial connection, so you can leave those fields empty.}}
 +
 +
[[Fichier:Hack-pycom-esp_32-50.png]]
 +
 +
That’s it for the first time configuration. In the lower portion of the screen, you should see the console, with the connection process taking place. At the end of it, you’ll get a ‘connected’ message and a colored '''>>>''' prompt, indicating that you are connected:
 +
 +
[[Fichier:Hack-pycom-esp_32-51.png]]
 +
 +
[https://www.youtube.com/embed/bL5nn2lgaZE There is also a video] that explains these steps on macOS (it is similar for other operating systems).
 +
 +
== Créer un projet ==
 +
Pymakr has a feature to sync and run your code on your device. This is mostly done using projects. The following steps will get you started.
 +
 +
* In Pymakr, go to Project > New project.
 +
* Give it a name and select a folder for your project, either a new of existing one.
 +
* Create two files: main.py and boot.py, if you don’t already have those.
 +
 +
{{ambox|text=You can also use FTP to download boot.py and main.py from the board to your project folder, after which you can right-click the project viewer and use the ‘add source files’ option to add them to your project.}}
 +
 +
The boot.py file should always have the following code on the top, so we can run our python scripts over serial or telnet. All of our newer boards have this code already in the boot.py file.
 +
 +
<syntaxhighlight lang="python">
 +
from machine import UART
 +
import os
 +
uart = UART(0, 115200)
 +
os.dupterm(uart)
 +
</syntaxhighlight>
 +
 +
Most users, especially WiPy users, would want a wifi script in the boot.py file. A basic wifi script but also more advanced WLAN examples, like fixed IP and multiple networks, can be found in the [https://docs.pycom.io/pycom_esp32/pycom_esp32/tutorial/includes/wlan.html#wlan-step-by-step Wifi Examples] chapter (''PyCom, anglais''). Nous avons également un tutoriel en Français sur le sujet (également applicable à Wipy2 et Lopy même s'il s'agit d'un tutoriel WiPy 1).
 +
 +
Besides the neccesary main.py and boot.py files, you can create any folders and python files or libraries that you want to include in your main file. Pymakr will synchronize all files in the project to the board when using the sync button.
    
{{LOPY-TRAILER}}
 
{{LOPY-TRAILER}}
29 917

modifications

Menu de navigation