python code for IoT Notes Printer using arduino Due

Python Code For IoT Notes Printer Using Arduino Due

Introduction :

In this article we going to implement IOT base project python code for IoT Notes Printer using arduino Duethis project tries to make a handable medium for everyday communication.

In this project we use Zerynth App (link is available in resources) this help you can write text messages and send them to a thermal printer and connected to the network using a microcontroller and a wi-fi chip.

Python Code For IoT Notes Printer Using Arduino Due
Python Code For IoT Notes Printer Using Arduino Due

Pre-requirement for python code for IoT Notes Printer using arduino Due:

  • Arduino IDE
  • Arduino Due
  • python envi.
  • Zerynth App
  • Hacksaw
  • Adafruit CC3000 wifi shield
  • Container
  • Adafruit Thermal Printer
  • STM32 Nucleo ST Nucleo

Procedure :

python code for IoT Notes Printer using arduino Due (VIPER)

# import all required library
import streams
from drivers.thermalprinter import thermalprinter
from wireless import wifi
from drivers.wifi.cc3000 import cc3000_tiny as cc3000
#Then import the viperapp module
from libs.apps import viperapp
p = thermalprinter.ThermalPrinter(SERIAL1,19200)


# save the template.html in the board flash with new_resource

# connect to a wifi network

    print("Establishing Link...")"SSID_WiFi",wifi.WIFI_WPA2,"PWD_WiFi")
except Exception as e:

def printMessage(msg):
    p.print_text("VIPER\n",justification="c", style="b")
    p.print_text("\n\n",justification="c", style="b")
    p.print_text("Take me!\n",justification="c", style="b")
#### ViperApp Setup    
# :: Javascript to Python ::
# the following function will be called when the template button is pressed
def show_message(msg):

# configure the viper app with a name, a descripton and the template url
vp = viperapp.ViperApp("Viper IoT Notes Printer","Print your message!","resource://template.html")

# everytime Javascript generates the event "showmsg" the function show_message is called

# run the ViperApp!
# since starts a new thread, you can do whatever else you want down here!


        <meta name="viewport" content="width=device-width, initial-scale=1">
        <div data-role="page">
            <div data-role="header" style="text-align:center"><h1>Viper Printer</h1></div>
            <div role="main" class="ui-content" style="text-align:center">
                <label>Write your note:</label>
                <textarea id='txtData' rows='5' ></textarea>
            <button type=button onclick="javascript:getValue();" id='btnGet'>Print!</button>
            <p id="label"></p>
            <div data-role="footer">Powered by Viper</div>
            function getValue () {
                var text=$("#txtData").val();


Summary :

In this article we implemented IOT base project Python Code For IoT Notes Printer Using Arduino Due. so about this project code you have any problem then please free to ask me

Resources : Arduino official site


I am Mr. Sachin pagar Embedded system engineer, the founder of Pythonslearning, a Passionate Educational Blogger and Author, who love to share the informative content on educational resources.

Have any Question or Comment?

Leave a Reply

Your email address will not be published. Required fields are marked *