The additional modules can be downloaded from the link of the libraries presented above or downloaded with the upip utility (Package Manager) from the REPL console if available in the Python Package Index (PyPI) repository

Below is a simple example that connects to the router and allows us to access the MicroPython console with the browser and WEBREPL.

boot.py code

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

#This file is executed on every boot (including wake-boot from deepsleep)

import esp

#esp.osdebug(None)

#Connects to the wifi AP providing a hostname, AP Name and passord

def do_connect():

import network

sta_if=network.WLAN(network.STA_IF)

ifnotsta_if.isconnected():

print('connecting to network...')

sta_if.active(True)

#Sets the device hostname

sta_if.config(dhcp_hostname='ESP_TEST')

print(sta_if.config('dhcp_hostname'))

#CHANGE THE VALUES TO YOUR ACCESSPOINT NAME AND PASSWORD

sta_if.connect('ACCESSPOINT','PASSWORDACCESSPOINT')

whilenotsta_if.isconnected():

pass

print('network config:',sta_if.ifconfig())

#Imports various modules for network, webrepl and garbage collector

import gc

import webrepl

import network

do_connect()

webrepl.start()

gc.collect()

At the first access it is required to enable webrepl to be executed in the REPL console with the command

1

import webrepl_setup

we can activate the service and the access password.

The procedure generates the webrepl_cfg.py file on the device.

After setting up and restarting, we access the web console by opening the locally cloned webrepl.html file with a browser

Pressing connect and after entering the password ,set in the initial setup, we access the console

Now we install from the WEBREPL console, for example, the stat module using upip

1

2

import upip

upip.install("micropython-stat")

To paste commands execute Ctrl+A e Ctrl+V

In this case the package was taken from the PYPI repository, unpacked and installed on the device.

We have noticed that some modules, although available on the repository, give an error during installation with upip; these modules are installed directly without using the upip utility,but by downloading the library from the site listed above and transferring the code to the device.

Once downloaded the package we must run it as an administrator;the installation of the Monaco font is required

After the font installation, we have the access to the IDE

We set the Location in Tools->Preferences->Language Location

and the serial port paramenters in Tools->Preferences->Serial

We plug the device into an USB port and set the serial port on uPyCraft

We choose the device type; in this case it is ESP8266

By clicking on the connection icon we access to the device and view the files on it

The firmware installation expands on the device only the Python file boot.py

The tool allows to download examples of MicroPython code for the board, blink.py for example

Clicking the “Download and Run” button we load the code onto the device and run it

In this example the led of the Nodemcu DevKit blinks.

Linux

The tool is similar in the Linux version; once downloaded the package to which we have to assign the execution right we run it. We must assign to the user the access to the serial port with the command, already seen above

1

sudo usermod-a-Gdialout USER

In our case, on Debian 9, we have the following screens similar to what we saw on Windows.

In the uPyCraft IDE

We set the Location in Tools->Preferences->Language Location

and the serial port paramenters in Tools->Preferences->Serial

We plug the device into an USB port and set the serial port on uPyCraft

We choose the device type; in this case it is ESP8266

By clicking on the connection icon we access to the device and view the files on it

The firmware installation expands on the device only the Python file boot.py

The tool allows to download examples of MicroPython code for the board, blink.py for example

Clicking the “Download and Run” button we load the code onto the device and run it

As in Windows the led of the Nodemcu DevKit blinks..

In version 0.30 for Windows we noticed some bugs, so for this operating system we continue to use the uPyCraft version 0.29.

Further informations about uPyCraft can be found at the following site

This article describes how to proceed to the autonomous creation of an image for the BeagleBone Black /Green using the Omap Image Builder. In this specific example we create the image for the BeagleBone Black Rev. C.

The informations on the procedure to be followed are available on the site

As a prerequisite to the creation of the image there is the need to perform the operations on arm hardware; with other systems it is possible to have issues. To this end, we will proceed to perform tasks on a Orange PI PC with Armbianoperating system. After preparing the Armbian system for Orange PI PC, as described in

Go into the image-builder/configs folder and copy a configuration as base named custom-debian.conf. We have used as a base configuration bb.org-debian-jessie-lxqt-4gb-v4.1.conf. In custom-debian.conf add the following changes in the deb_include section; as example we add the vsftpdserver; change the chroot_script value too

1

2

3

4

5

6

7

deb_include==" \

alsa-utils \

.......

xserver-xorg-video-modesetting \

vsftpd \

"

1

chroot_script="custom-debian.sh"

To exclude packages to be installed use the deb_exclude section. In the script are commented the various sections, among which we find those about the definition of the hostname, passwords, user name creation, etc.

Navigate to the image-builder/target/chroot folder and copy beagleboard.org-jessie.shascustom-debian.sh.

If you want to add python packages edit the custom-debian.sh file and add the other packages in install_pip_pkgsfunction

as an example we show how to interact with the Beaglebone and a temperature and humidity sensor.

Among the most popular we finde the DHT11 sensor. The sensor has 4 pin; we have to connnect it to the power supply through a resistance of 4.7 or 10 kΩ. In our case we have a three-pin DHT11 sensor with the resistance already included in the circuit. In the case of the only sensor follow as specified in the following article

Now we shall configure Eclipse and BeagleBone to debug the code directly on BeagleBone.

On BeagleBone install gdbserver

1

sudo apt-get install gdbserver

On the Debian system with Eclipse install gdb-multiarch

1

sudo apt-get install gdb-multiarch

From Eclipse access to Run-> Debug Configurations

Double-click C++ Remote Application to set parameters

At the next window, create a new ssh connection with the New button

Enter the parameters for the connection

Set the remote destination folder for the file and execution management; with the browse button choose where to copy the files, and with the field “Commands to execute before application” will give execute permissions to the file

In our case we create a folder esempi under /root on the BeagleBone where to debug remotely

Set the multarch debugger in the Debugger Tab and other startup parameters and gdb command line settings

Set the port of the remote debug server installed on BeagleBone in the Gdbserver Settings Tab