Tag Archives: arm

OctoPrint installation on Orange PI PC – Print Test File

After the OctoPrint server configuration

Printer settings

we set the connection parameters for the printer.

After connecting to the OctoPrint server with the octoprint user and password as password, we set up the printer connection

octoprint-connessione

With these settings it is possible to print a gcode file already generated with Cura or Slic3r

Cura

Slic3r

or upload a stl file on which the slice will be executed using the loaded cura profile and the CuraEngine on the Orange Pi PC system.

In the case where a stl file is imported, the slicing of the file is proposed

octoprint-sliceAt this point the file is ready for printing

octoprint-fileslicedOnce the printing is started, the progress and temperature can be checked

octoprint-progressbaras the layers that are being created

octoprint-sliceprogressIn this example, the basic settings were used to start the system for the first time.

For further information and configurations on OctoPrint refer to the software documentation

Octoprint Documentation

At the following link the supported printers are listed

Supported printers

OctoPrint installation on Orange PI PC – Printer Settings

After  defining the local hostname resolution

Local Hostname Resolution

at this point it is necessary to configure the printer.

WARNING: Use of the settings shown is at your own risk. We assume no responsibility if these settings cause malfunctions or breakage of the printer.

At the first access to OctoPrint, the basic parameters for managing the printer are requested. In our case, we connect the Orange PI PC to an Anet A8 3d printer via the USB port. At the first access to the address

http://3dprinter.local

 a configuration mask is shown

octoprint-accesspressing next we access the next screen where to define the user who manages the printer with his password

octoprint-accesscontrolWe press Keep Access Control; the next step is  the control of the Internet connection in which we disable the Connectivity Check

octoprint-accessconnectivityWe have to import our cura profile for Anet A8 and set  the path to the executable CuraEngine, compiled in the previous article

Octoprint Installation

octoprint-printerprofile

octoprint-curaengine

The imported profile must be generated by Cura 15.04.x or older. Below is the link to the various versions of the Cura software

Cura

We can now define the parameters of the printer, in our case Anet A8

octoprint-printer1We set the bed size and print volume

octoprint-printer2The speed of movement using the control panel is defined in the next step; we set up conservative parameters

octoprint-printer3Finally, we set the extruder parameters

octoprint-printer4

At the next screen we set the commands to be sent to Debian directly from OctoPrint; they are set as follows

octoprint-command

where in the password you must enter the password to run the root commands on Debian.


The folder in which Octoprint has been installed is inserted for the software update

octoprint-swupdateWe do not insert anything for the webcam

octoprint-webcamFinally, the configuration is completed with the Finish button.

octoprint-finishFor more OctoPrint settings and addons refer to the site

OctoPrint

In the next article we’ll print a test model

Print test file

OctoPrint installation on Orange PI PC – Local Hostname Resolution

After configuring haproxy for the use of content in http on the standard port

HAProxy Installation

we configure the Linux machine to publish the hostname on the network with the avahi daemon.

On Linux and OSX machines this service is natively visible, while for Windows systems it is necessary to install the Bonjour service

Bonjour application for windows

On the Orange PI PC the avahi daemon must be installed with the command

We change the name to which our 3D print server must match in the two files /etc/hosts and /etc/hostname

In our case the name orangepcpc has been changed to 3dprinter.

Restarting the linux box, the services are accessible  using the name 3dprinter.local.

avahiIn the next article we’ll show a printer configuration

Printer Settings

OctoPrint installation on Orange PI PC – HAProxy Installation

After the automatic start of OctoPrint configuration

OctoPrint Autostart

at this point we can set up the system to answer to the standard port of an Http server.

For this purpose we install and configure the HAProxy reverse proxy

HAproxy

Proceed to the installation

Edit the /etc/haproxy/haproxy.cfg file and add to the default the directives including also the use of webcam

Restart the proxy with the command

Restart the Orange PI. If everything is configured correctly, the 3D print server answers on port 80  of the Orange Pi PC ip address

http://ORANGEPIPC_IP

haproxyIt is possible to map the Octoprint service on port 5000 only to the loopback interface by editing the file ~/.octoprint/config.yaml

and adding the host reference under the server directive

Restart OctoPrint

Now the 5000 port is mapped only with the address 127.0.0.1.

In the next article, we’ll configure Linux to publish the hostname on the network so that it can be accessed through this reference without using the IP address

Local Hostname Resolution

OctoPrint installation on Orange PI PC – Autostart

After the installation of OctoPrint and CuraEngine in the previous article

OctoPrint Package Installation

we treat now the configuration of the 3d print server.

As first operation, we set up the automatic startup of OctoPrint.

Run the following commands

Edit the /etc/ defaults/octoprint file changing the pointing to the executable to start OctoPrint using vi

or nano

and edit the file from

to

taking into account also the different user being used.

Add the script to startup automatically OctoPrint

Start OctoPrint  with the command

Check that OctoPrint is active on port 5000 of the Orange PI PC by accessing the address

Rebooting the Orange PI PC, the OctoPrint server now starts automatically.

In the next article, Linux will be configured to connect to OctoPrint on the Http standard port, i.e. on  port 80

HAProxy Installation

OctoPrint installation on Orange PI PC – Python package installation

This article describes how to enable the Orange PI PC board to work as 3d printers network server.

A  software that provides this functionality is OctoPrint

OctoPrint

From the OctoPrint site we can download an image for Raspberry PI with the system already ready; in the case of the Orange PI PC we have  to install and configure OctoPrint on a Linux image.

You can also use a Linux image available for Orange PI PC and run the steps related to OctoPrint package installation, but you have to check the prerequisites for Octoprint python package installation.

We instead built for this article an image using the Armban scripts.

As a first step, prepare the micro sd card with an Armbian image. In the specific case, we’ll use a Debian Jessie image created using the Armbian script, as indicated on the link

Armbian building

and described also in a previous article

Building Armbian image for Orange PI PC

We followed these steps to build the Armbian image on Ubuntu Xenial 16.04; from  a Linux command shell

In the building options choose

armbianopipcfosWe selected the default kernel configuration

armbianopipckernelChoose an Orange PI PC board

armbianopipcboardWe used the mainline kernel

armbianopipcmlkerneland Debian Jessie as distribution

armbianopipcjessieWe built an image with desktop envinronment

armbianopipcjessiedeAfter this option, the script proceeds to the compilation. The generated image is Armbian_5.34_Orangepipc_Debian_jessie_next_4.13.12_desktop.img. This image can be downloaded from the link

Armbian image for Orange Pi PC

Start Armbian and create the user for the Jessie image; in this case we choose octoprint/password as user.

If necessary, reconfigure the keyboard with the command

and proceed to upgrade the system

If the system needs to be configured via a wireless connection, the connection must be active at startup. For this purpose in our case we used the Wicd daemon

Wicd Debian

Remove the network-manager package

This command uninstalls network-manager and network-manager-gnome.

Check that the wireless interface is not present in

/etc/network/interfaces

Proceed to Wicd installation

Check that the octoprint user is present in the netdev group

In our case it is already present, giving as a result

netdev-group

If not present, add it with the command

Start  wicd

Logon to the armbian graphic desktop and start the wireless configuration with the command

wicd-client

Configure and save the network connection from the graphical interface.

If you want the remote desktop follow the steps listed in the article

Remote desktop setup for Armbian on Orange PI PC

We can now install Octoprint. Follow the steps available at the link

OctoPrint installation on Linux

Install the prerequisites

Create under /opt the octoprint folder and assign the ownership  to octoprint

In a Linux shell command go to /opt/octoprint  folder and download the software

Run

Create the  .octoprint folder

Add  octoprint to the following groups  to manage the 3d printer using the USB port

Check  the correct installation by running the command

The OctoPrint server can be reached on port 5000 at the IP address of Orange PI PC

http://ipaddress:5000

octoprinttest

Install the Cura Engine at this point; place yourself in the octoprint user’s home and download the source package

Unpack the package

Go into  the unpacked folder

Run  the compilation with the command

The compiled software is located under the build folder

curaengineCreate the /opt /octoprint/cura folder and copy the CuraEngine file to this folder

The executable is now in the /opt/octoprint/cura folder and will be used later by OctoPrint.

In the next article we’ll treat how to configure OctoPrint’s automatic startup

OctoPrint Autostart

Mqtt with Beaglebone and ESP8266 – Articles List

Below is a list of the  articles to follow  to build your IOT environment consisting of sensors and relays with Beaglebone, ESP8266 and MQTT Mosquitto server.

  1. Architecture and Mqtt protocol
  2. Mosquitto Mqtt installation on Beaglebone
  3. Mqtt on ESP8266
  4. Temperature sensor on ESP8266 with Mqtt protocol
  5. Relay on ESP8266 with Mqtt protocol
  6. Configuration of Http server, Mqtt websocket protocol on Beaglebone
  7. Freeboard dashboard installation and configuration on Beaglebone
  8. Android client to manage sensors with Mqtt protocol

Mqtt with Beaglebone and ESP8266 – Android Client

After Mosquitto server, ESP8266 nodes and Freeboard configuration

Mqtt with Beaglebone and ESP8266-Mosquitto installation on Beaglebone

MQTT with BeagleBone and ESP8266-MQTT ESP8266

MQTT with BeagleBone and ESP8266 – MQTT on ESP8266 with temperature sensor

MQTT with BeagleBone and ESP8266 – MQTT on ESP8266 with Relay

Mqtt with Beaglebone and ESP8266 – Freeboard

now we can proceed to use a Mqtt Client on an Android device.

In the Playstore various Mqtt applications are available

android mqttAfter the publishing and subscriber topics configuration in the Android client , analogous to what has been done for Freeboard widgets

Mqtt with Beaglebone and ESP8266 – Freeboard

it is possible to monitor the sensor temperature and humidity, the devices status and send commands to the relay (Turn On, Turn Off, Status, Restart, Sleep) and to the sensor (Restart, Sleep, Status).

Here is a screenshot with some subcriber topic and publisher topics of our installation using MQTT Dashboard

android mqtt relayoffWith the relay on

android mqtt relayon

Mqtt with Beaglebone and ESP8266 – Freeboard

After the Mqtt web client installation

MQTT with Beaglebone and ESP8266 – WebServer and MQTT WebSocket

let’s install now the dashboard freeboard

Freeboard

In a ssh commad shell go into the /var/www/html  folder on Beaglebone as root and clone the freeboard github respository; change the owner of the freeboard folder in www-data:www-data

With a web browser go to the freeboard  folder on Beaglebone webserver to access the dashboard

freeboard

We have to add now Freeboard additional plugins. We add the following

  •  freeboard-mqtt

Clone the https://github.com/alsm/freeboard-mqtt github

Download the mqtt paho javascript library

Paho mqtt javascript library

Here is the direct link to the library

Last Version mqttws31.js

Create the mqtt folder under the Freeboard plugins folder and copy the mqttws31.js and paho.mqtt.plugin.js files

Edit the paho.mqtt.plugin.js file and insert the reference to the mqttws31.js library in the external_scripts section; in this case too we have to change the folder and contents owner

Change the owner

Edit the /var/www/html/freeboard/index.html file and insert the reference to the paho.mqtt.plugin.js plugin in the heads.js section

  • Add the dynamic-highcharts plugin

Clone in a folder the github

Copy the plugin_highcharts.js to the folder /var/www/html/plugins/thirdparty and change the owner

Edit again the file /var/www/html/freeboard/index.html and add the plugin as done above

Access now the Freeboard dashboard and add the links to the temperature and humidity topics, the gauges and timeseries mesauring the values in real time and in a specific range of time . Here are some settings:

  • Datasource

freeboard datasource

  • Gauge

freeboard gauge

  • Timeseries

freeboard timeseriesChrome/Chromium browser allows to save the settings in a json file. This settings can be loaded locally or loaded from the web server, saving for example the dashboard.json file in /var/www/html/freeboard,  with the url

The image shows the Freeboad interface with various widgets showing the status and timeseries of the ESP8266 relay and sensors

freeboard dashboard

In these series of articles we configured the envinronment to access the Beaglebone using the beaglebone.local/beaglebone alias

Debian sd card setup for Beaglebone Black

but you can use anyway the Beaglebone IP tho access the services provided by the board.

In the next article we’ll treat the Mqtt Android client

Mqtt with Beaglebone and ESP8266 – Android Client

 

 

 

MQTT with BeagleBone and ESP8266 – WebServer and MQTT WebSocket

After the MQTT server and  ESP8266 nodes configurations

MQTT with BeagleBone and ESP8266 – Mosquitto installation on Beaglebone

MQTT with BeagleBone and ESP8266-MQTT ESP8266

MQTT with BeagleBone and ESP8266 – MQTT on ESP8266 with temperature sensor

MQTT with BeagleBone and ESP8266 – MQTT on ESP8266 with Relay

we analize now the webserver configuration on BeagleBone and  the Websocket configuration for the broker MQTT mosquitto always on Beaglebone.

First step is to access on the Beaglebone in ssh and disable the following services

Go into the folder /etc/apache2/sites-enabled and modfy 000-default.conf  changing the webserver port from 8080 to 80

In /etc/apache2/port.conf modify the listening port from  8080  to 80

Restart the Http server

Go into folder  /etc/mosquitto/conf.d and create a new file websockets.conf with the following contents inside

Save the file and restart Mosquitto

Disable the IPV6 protocol on  Beaglebone as described at the following link

Disable IPV6 in Debian

In the file /etc/sysctl.conf add

Restart the Beaglebone.

We proceed at this point to install on the http server a MQTT Websocket client and the Freeboard dashboard.

As for the MQTT Websocket client hive-MQTT we download the code from github

Hive mqtt

Log in as root in ssh on Beaglebone and go into /var/www/html folder;  clone the Mqtt client into mqtt-web folder and change the owner of this folder

With a web browser navigate on our Http server to the mqtt-web link obtaining the Mqtt Web client; we can now set the parameters for the connection to the Mosquitto Mqtt Broker

mqtt web client connectionPopulating the values for the subscription and publishing topics we can access to the messages of the topics and the ability to perform a command to the publishing topic

mqtt web clientIn the next article we’ll install the Freeboad dashboard on the Beaglebone

Mqtt with Beaglebone and ESP8266 – Freeboard