New Walkeremoteboard-mcp001-rev1


Easy to use yet offering advanced control capabilities, the Walkeremoteboard-mcp001-rev1 is designed to
effortlessly manage Relay, Stepper, Brushless, and wheel motors, accommodating voltages from 5V to 27V
with appropriate bridges. The onboard L293D driver facilitates direct usage of wheel motors,
while an integrated relay allows for convenient control of headlights.
With 10 auxiliary pinouts, users can activate additional functionalities via auxiliary controls,
already available in their own pilot station accessible on our website. Additionally, accessing your
pilot station is as simple as scanning the QR code on the board to obtain the email and password for login.

Moreover, with the new firmware, the board ensures it never loses internet connection. In the event of
disconnection while in operation, the motors will rotate in reverse for 20 seconds, allowing the board to
reconnect within the WiFi coverage area. Additionally, it's worth noting that
The Walkeremoteboard has been enhanced with the latest firmware,
which can be conveniently installed directly from the dedicated command page.
By clicking the OTA UPGRADE button, the button will flash for a few seconds,
and the Walkeremoteboard will have the multicolor LED turned off and the blue LED of
the microcontroller turned on. Once the OTA update operation is completed, the button on the
command page will stop flashing, displaying a green color with the "successfull" message.
The blue LED on the board will turn off, while the multicolor LED indicating the
connection to the server will be lit.

For first wifi setting connection CLICK HERE for Youtube tutorial



WALKEREMOTEBOARD SIMPLE TO USE FOR
IOT EXPERIMENTAL PROJECTS


dev/board esp8266 onboard programmed for use it from walkeremote portal
for more learn follow the X (twitter) social





CREATE YOURSELF A TELEPRESENCE SYSTEM HOMEMADE
WITH A RASPBERRY AND ARDUINO

Welcome to walkeremote portal. Sign Up to create your pilot station for telepresence system with use of Raspberry, actionoiseboards, old notebook or mobile phone for recycle it.
For Actionoiseboard Hardware and general Tutorials: HERE
Below Last script updated and Schematics.



Use of pilot station with notebook keyboard:


arrow keys for direction, k=nord,l=sud
p=Gohead,x=stop.
Reboot from pilot.station:
write the number 888 in first
arrow form and click red button send,immediatley
need to change the parameter for avoid the
continous reboot of Dev Board
SwitchOn lighthouse in GPIO2:
write lon in first arrow form
and click send red button.
SwitchOff lighthouse in GPIO2:
write lof in first arrow form
and click send red button.
switch on Relay1 from ActionoiseRemoteModule:
write h1 in first arrow form
and click send red button.
switch on Relay2 from ActionoiseRemoteModule:
write h2 in first arrow form
and click send red button.
switch on Relay3 from ActionoiseRemoteModule:
write h3 in first arrow form
and click send red button.
switch on Relay4 from ActionoiseRemoteModule:
write h4 in first arrow form
and click send red button.

Some of many web site
To create new Database account for free are:
freesqldatabase.com/
db4free.net
freemysqlhosting.net
After registration an email with credentials
will be received,copy and paste the credentials to blanck form in ADD DB menu button
and inside the db variable of python script below


Example of python code
to read database's values


#copy and paste this code in a file py with name Neww.py

import stop                #file stop.py necessary in the same folder of Neww.py    
import pymysql.cursors       #stop.py file coming soon
import RPi.GPIO as GPIO
import time
import subprocess
from threading import Timer
from RpiMotorLib import RpiMotorLib   #stepper motor library
from smbus import SMBus #i2c connection for ActionoiseRemoteModule
addr = 0x8    #bus adress
bus = SMBus(1)

GPIO.setmode(GPIO.BCM)
nord=[21,20,16,12]
sud=[12,16,20,21]
obstacle=0
mymotor=RpiMotorLib.BYJMotor('MyMotorOne','28BYJ')  #Stepper Motor
GPIO.setup(21,GPIO.OUT)
GPIO.setup(20,GPIO.OUT)   #GPIO Pins connected to driver L298n
GPIO.setup(16,GPIO.OUT)
GPIO.setup(12,GPIO.OUT)
GPIO.setup(2,GPIO.out)    #5v d-led connected in a npn transistor(bc337) in pin2
GPIO.setup(17,GPIO.OUT)   
GPIO.setup(22,GPIO.OUT)   #GPIO Pins connected to driver L298n
GPIO.setup(23,GPIO.OUT)   #GPIO connected to driver L298n
GPIO.setup(24,GPIO.OUT)   #GPIO connected to driver L298n
GPIO.setup(5,GPIO.OUT)    #GPIO connected to driver L298n
GPIO.output(17,GPIO.HIGH) #relay connected with a bc337 transistor for deactivate the motor driver during the boot

#date of access to  database
db=pymysql.connect(host="",port=3306,user="",password="",db="",charset="utf8mb4") 
cursor=db.cursor()
sql="SELECT comandi FROM pilotino" #table and row
cur=cursor.execute(sql)
result=cursor.fetchone()


GoHeadTime="SELECT gohead from MotionTime"
time1=cursor.execute(GoHeadTime)
result1=cursor.fetchone()

GoBottomTime="SELECT gobottom from MotionTime"
time2=cursor.execute(GoBottomTime)
result2=cursor.fetchone()

GoRight="SELECT goright from MotionTime"
time3=cursor.execute(GoRight)
result3=cursor.fetchone()

GoLeft="SELECT goleft from MotionTime"
time4=cursor.execute(GoLeft)
result4=cursor.fetchone()

Gorallent="SELECT goralle from MotionTime"
time5=cursor.execute(Gorallent)
result5=cursor.fetchone()



for a in result1:
           print(a+" gohead-time-variable")
           
      
for e in result5:
           print(e+" gorallent-time-variable")
         
         
for b in result2:
          print(b+" bottom-time-variable")
          
          
for d in result3:
          print(d+" bottom-time-variable")
         
for c in result4:
          print(c+" right-time-variable")



   
def check():
    if(cur > 0):
         for x in result:
             if(x=="h"):
                    print("right")
                    GPIO.output(22,GPIO.LOW)  #right
                    GPIO.output(23,GPIO.HIGH)
                    GPIO.output(24,GPIO.HIGH)
                    GPIO.output(5,GPIO.LOW)
                    time.sleep(float(d))           
                    GPIO.output(22,GPIO.LOW)
                    GPIO.output(23,GPIO.LOW)
                    GPIO.output(24,GPIO.LOW)
                    GPIO.output(5,GPIO.LOW)
                    via()
                    #Timer(5, via).start()
                    
             if(x=='nord'):
                  print('nord')
                  mymotor.motor_run(sud, .1/50,30,False,False,'half', .100)
                  via()
             
             
             
             if(x=='sud'):
                  print('sud')
                  mymotor.motor_run(nord, .1/50,30,False,False,'half', .100)
                  via()
                              
                    
             if(x=="g"):
                    print("left")
                    GPIO.output(22,GPIO.HIGH)  #left
                    GPIO.output(23,GPIO.LOW)
                    GPIO.output(24,GPIO.LOW)
                    GPIO.output(5,GPIO.HIGH)
                    time.sleep(float(c))
                    GPIO.output(22,GPIO.LOW)
                    GPIO.output(23,GPIO.LOW)
                    GPIO.output(24,GPIO.LOW)
                    GPIO.output(5,GPIO.LOW)
                    via()
              
              
             #if(x=="s"):
                    #print("stop")
                    #GPIO.output(22,GPIO.LOW)   #stop
                    #GPIO.output(23,GPIO.LOW)
                    #GPIO.output(24,GPIO.LOW)
                    #GPIO.output(5,GPIO.LOW)
                    #via()
                    #Timer(0.50, via).start() 
              
              
              
             if(x=="b"):
                    print("bottom")
                    GPIO.output(22,GPIO.HIGH)  #bottom
                    GPIO.output(23,GPIO.LOW)
                    GPIO.output(24,GPIO.HIGH)
                    GPIO.output(5,GPIO.LOW)
                    time.sleep(float(b))
                    GPIO.output(22,GPIO.LOW)
                    GPIO.output(23,GPIO.LOW)
                    GPIO.output(24,GPIO.LOW)
                    GPIO.output(5,GPIO.LOW)
                    via()
              
             if(x=="ra"):
                    print("GoRallent")
                    GPIO.output(22,GPIO.LOW)  #Gorallent
                    GPIO.output(23,GPIO.HIGH)
                    GPIO.output(24,GPIO.LOW)
                    GPIO.output(5,GPIO.HIGH)
                    time.sleep(float(e))
                    GPIO.output(22,GPIO.LOW)
                    GPIO.output(23,GPIO.LOW)
                    GPIO.output(24,GPIO.LOW)
                    GPIO.output(5,GPIO.LOW)
                    via()
                   
                   
                    
                    
             if(x=="y"):
                    
                    print("go no obstacle")
                    GPIO.output(22,GPIO.LOW)  #go straight.
                    GPIO.output(23,GPIO.HIGH)
                    GPIO.output(24,GPIO.LOW)
                    GPIO.output(5,GPIO.HIGH)
                    time.sleep(float(a))
                    GPIO.output(22,GPIO.LOW)
                    GPIO.output(23,GPIO.LOW)
                    GPIO.output(24,GPIO.LOW)
                    GPIO.output(5,GPIO.LOW)
                    via()
            
                    
                    
                    
                                          
                                        
                    
    if(cur==0): 
          print("no command inserted")
          db.close()
          quit()
     
    via()    
           
def via():
    canc="delete from pilotino"
    cursor.execute(canc)
    db.commit()
    db.close()
    quit()         



if(a=='888'):
    subprocess.Popen(['sudo','reboot','-h','now'])

if(a == 'lon'):
    GPIO.output(2,GPIO.HIGH)  #lighthouse on in GPIO2

if (a=='lof'):
    GPIO.output(2,GPIO.LOW)     #lighthouse off in GPIO2

if (a == "h1"):
       bus.write_byte(addr, 0x1)    #relay1 from module
       dele="delete from MotionTime"
       cursor.execute(dele)
       db.commit()    
       delay(2)
       quit()  

if (a == "h2"):
       bus.write_byte(addr, 0x2)    #relay2 from module
       dele="delete from MotionTime"
       cursor.execute(dele)
       db.commit()    
       delay(2)
       quit()  

if (a == "h3"):
       bus.write_byte(addr, 0x3)    #relay3 from module
       dele="delete from MotionTime"
       cursor.execute(dele)
       db.commit()    
       delay(2)
       quit()      

if (a == "h4"):
       bus.write_byte(addr, 0x4)     #relay4 from module
       dele="delete from MotionTime"
       cursor.execute(dele)
       db.commit()    
       delay(2)
       quit()            

check()
db.close()
  
    

ArduinoCode for i2c connection.


//arduino code for use of ActionoiseRemote Module/433mhz 
//arduino connected to raspberry with i2c module 

#include 
#include   //VirtualWire Library available in  
int a = 0;                //actionoise.com -Download Section-
int b= 0;
int t= 0;
int d=0;
int f=0;
void setup() {
  // Join I2C bus as slave with address 8
  Wire.begin(0x8);
  
  // Call receiveEvent when data received                
  Wire.onReceive(receiveEvent);
  
  // Setup pin 13 as output and turn LED off
  
}
 
// Function that executes whenever data is received from master
void receiveEvent(int howMany) {
  while (Wire.available()) { // loop through all but the last
    char c = Wire.read(); // receive byte as a character
    if(c == 0x1){
       a = 1;
    } 
     if(c == 0x2){
       b = 1;
  }
  
     if(c == 0x3){
       t = 1;
  }
  
     if(c == 0x4){
       d = 1;
  }
   
     
  if(c==0x6){
    f=1;
  }
}}

void loop() {
  

  if (a == 1){
  vw_set_ptt_inverted(true);
          vw_setup(4000);
        
       const char *msg = "A"; // trasmette su piedino4(at6)  ricevitore        
        vw_send((uint8_t *)msg, strlen(msg)); //sending the message
        vw_wait_tx(); //wait untill the whole message is gone
        delay(500);
      a=0;
  }
  if (b == 1){
  vw_set_ptt_inverted(true);
          vw_setup(4000);
        
       const char *msg = "B"; // trasmette su piedino4(at6)  ricevitore        
        vw_send((uint8_t *)msg, strlen(msg)); //sending the message
        vw_wait_tx(); //wait untill the whole message is gone
        delay(500);
      b=0;
  }
  if (t == 1){
  vw_set_ptt_inverted(true);
          vw_setup(4000);
        
       const char *msg = "C"; // trasmette su piedino4(at6)  ricevitore        
        vw_send((uint8_t *)msg, strlen(msg)); //sending the message
        vw_wait_tx(); //wait untill the whole message is gone
        delay(500);
      t=0;
  }
  if (d == 1){
  vw_set_ptt_inverted(true);
          vw_setup(4000);
        
       const char *msg = "D"; // trasmette su piedino4(at6)  ricevitore        
        vw_send((uint8_t *)msg, strlen(msg)); //sending the message
        vw_wait_tx(); //wait untill the whole message is gone
        delay(500);
      d=0;
  }
  
  }


PythonCode for HC-sr04 ultrasonic sensor


#obstacle sensor detect
#copy and paste this code in a file py with name stop.py
import subprocess
import pymysql.cursors
import Neww             #put in the same folder the python script Neww.py
import RPi.GPIO as GPIO
from Bluetin_Echo import Echo    #library for obstacle sensor
GPIO.setwarnings(False)
TRIGGER_PIN = 15
ECHO_PIN = 14
speed_of_sound = 250
echo = Echo(TRIGGER_PIN, ECHO_PIN, speed_of_sound)
samples = 10
resu = echo.read('cm', samples)
# Print result.
obstacle=0
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
db=pymysql.connect(host="",port=3306,user="",password="",db="",charset="utf8mb4") 
cursor=db.cursor()
sql="SELECT comandi FROM pilotino" #table and row
cur=cursor.execute(sql)
result=cursor.fetchone()

GPIO.setup(22,GPIO.OUT)   #GPIO Pins connected to driver L298n
GPIO.setup(23,GPIO.OUT)
GPIO.setup(24,GPIO.OUT)
GPIO.setup(5,GPIO.OUT)
                     
         
if (resu < 40):    # 40 is the value of distance sensor before to interrupt the motors loop can change with own value.
      print('obstacle detected')
      GPIO.output(22,GPIO.LOW)
      GPIO.output(23,GPIO.LOW)
      GPIO.output(24,GPIO.LOW)
      GPIO.output(5,GPIO.LOW)
      canc="delete from pilotino"
      cursor.execute(canc)
      db.commit()
      subprocess.call(['sh','./close.sh'])      #launch of close bash file for interrupt the motors loop 
         
     
print ('no obstacle detected')      


PythonCode for DHT11 Temperature Sensor.


#Humidity/Temeperature sensor DHT11 +
#Raspberry CPU Reader +
#DataTime
#copy and paste in a file with temp.py name
#Code in Action from remote place in link below:
#https://www.actionoise.com/tempr.php
from gpiozero import CPUTemperature
from datetime import datetime    
from threading import Timer
import pymysql.cursors
import Adafruit_DHT
cpu=CPUTemperature()
internal=(cpu.temperature)
sensor=Adafruit_DHT.DHT11
pin=18
humidity,temperature = Adafruit_DHT.read_retry(sensor,pin)

db=pymysql.connect(host="",port=3306,user="",password="",db="",charset="utf8mb4")

cursor=db.cursor()
data1=datetime.now()

    #time.sleep(0.1)
#sql= "insert into sensor (temp,hum,date,cpu) values (%s,%s,%s,%s)"
#cursor.execute(sql,(data1,temperature,humidity,internal))
#sql="SELECT * FROM users"
        
def tira():
    canc="delete from sensor"
    cursor.execute(canc)
    db.commit()
    quit()
    #Timer(5.0, rimbalzo).start()

def rimbalzo():
    humidity,temperature = Adafruit_DHT.read_retry(sensor,pin)
    data1=datetime.now()
    sql= "insert into sensor (temp,hum,date,cpu) values (%s,%s,%s,%s)"
    cursor.execute(sql,(temperature,humidity,data1,internal))
    db.commit()
    Timer(10.0, tira).start()
    
rimbalzo()

copy and paste this code below
and rename close.sh


#!/bin/bash
killall python3

below 3 last sh file for launch the
py script in autostart
copy paste and rename in 3 sh file
Below the sh for launch the Neww.py script.Rename it in launch.sh


#!/bin/bash
while true;
do
python3 Neww.py;done

below the sh file for launch the stop.py script.rename it in stoppa.sh


#!/bin/bash
while true;
do
python3 stop.py;done

below the sh file for launch the temp.py script.rename it in temp.sh


#!/bin/bash
while true;
do
python3 temp.py;done
Now there are 2 file python Neew.py - stop.py
and 3 sh file that whe can rename : close.sh - launch.sh - stoppa.sh
insert all file inside the folder pi of your raspberry and digit in terminal for every
file : sudo chmod 777 filename for admin permission
at the end go to autostart file, from terminal digit
cd ../../etc/xdg/lxsession/LXDE-pi press enter
inside LXDE-pi digit: sudo nano autostart
add to file this two string:
@lxterminal -e /home/pi/launch.sh
@lxterminal -e /home/pi/stoppa.sh
press ctrl + x and y at the end and finish , reboot the raspberry and you can see in your screen the 2 file py launch it in autostart.

Follow the Actionoise Twitch channel and join to live
for more tutorials and try yourself from remote the raspberry robocars.


Database's tables and
rows creation


Create inside the db a table with name
MotionTime
and inside this one
create 5 columns with same order and name like below:
gobottom gohead goleft goralle goright,
select VARCHAR in variable form and 128 in lenght form
same for every columns.

create another table inside the same db with name:
pilotino and
inside pilotino create a column with name:
comandi and same VARCHAR variable and 128 in lenght form

for resolve error about max_connections, just need
modify the mysql global variable max_connections
digit in mysql console: SHOW VARIABLES LIKE "MAX_CONNECTIONS";
and in case of a value low increase with the command:
SET GLOBAL MAX CONNECTIONS=10000; Press CTRL+Enter from phpmyadmin

SET GLOBAL WAIT_TIMEOUT=1; Press CTRL+Enter from phpmyadmin
For temperature and humidity sensor
inside the same database, create a table
with name sensor ,and inside create 4 colums
with the same name and order:
temp hum date cpu
with VARCHAR variable and 128 of lenght

Send Commands with MQTT protocol.

Another solution to send commands from remote is the MQTT protocol
the same to use for Internet of things
below the python script for the raspberry car and for the
remote device used for send message-commands.


#install before the paho.mqtt library 
#and start this script inside a raspberry 
#assembled with same schematic up this page
from RpiMotorLib import RpiMotorLib
import paho.mqtt.client as mqtt
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
import time
GPIO.setmode(GPIO.BCM)

nord=[21,20,16,12]
sud=[12,16,20,21]
mymotor=RpiMotorLib.BYJMotor('MyMotorOne','28BYJ')  #Stepper Motor
GPIO.setup(21,GPIO.OUT)
GPIO.setup(20,GPIO.OUT)   #GPIO Pins connected to driver L298n
GPIO.setup(16,GPIO.OUT)
GPIO.setup(12,GPIO.OUT)
GPIO.setup(17,GPIO.OUT)   
GPIO.setup(22,GPIO.OUT)   #GPIO Pins connected to driver L298n
GPIO.setup(23,GPIO.OUT)   #GPIO connected to driver L298n
GPIO.setup(24,GPIO.OUT)   #GPIO connected to driver L298n
GPIO.setup(5,GPIO.OUT)    #GPIO connected to driver L298n
GPIO.output(17,GPIO.HIGH) #relay connected with a bc337 transistor for deactivate the motor driver during the boot
#stepper motors
def on_connect(client, userdata, flags, rc):
    print(f"connected with result code {rc}")
    client.subscribe(".....")

mymessage =''

def on_message(client,userdata,msg):
    global mymessage
    mymessage = str (f"{msg.payload}")
    print (mymessage)
    if(mymessage== "b'nord'"):
        print('comando ricevuto')
        mymotor.motor_run(sud, .1/50,30,False,False,'half', .100)
    
    if(mymessage=="b'sud'"):
            print('comando ricevuto')
            mymotor.motor_run(nord, .1/50,30,False,False,'half', .100)
    
 
    
  
    if(mymessage=="b'right'"):
                    print("right")
                    GPIO.output(22,GPIO.LOW)  #right
                    GPIO.output(23,GPIO.HIGH)
                    GPIO.output(24,GPIO.HIGH)
                    GPIO.output(5,GPIO.LOW)
                    time.sleep(float(0.4))
                    GPIO.output(22,GPIO.LOW)  #stop
                    GPIO.output(23,GPIO.LOW)
                    GPIO.output(24,GPIO.LOW)
                    GPIO.output(5,GPIO.LOW)  
                    
    if(mymessage=="b'stop'"):
                    print("stop")
                    GPIO.output(22,GPIO.LOW)  #stop
                    GPIO.output(23,GPIO.LOW)
                    GPIO.output(24,GPIO.LOW)
                    GPIO.output(5,GPIO.LOW)                          
                    
 
     
    if(mymessage=="b'left'"):
            print("left")
            GPIO.output(22,GPIO.HIGH)  #left
            GPIO.output(23,GPIO.LOW)
            GPIO.output(24,GPIO.LOW)
            GPIO.output(5,GPIO.HIGH)
            time.sleep(float(0.4))
            GPIO.output(22,GPIO.LOW)  #stop
            GPIO.output(23,GPIO.LOW)
            GPIO.output(24,GPIO.LOW)
            GPIO.output(5,GPIO.LOW)  


    if(mymessage=="b'bottom'"):
            print("bottom")
            GPIO.output(22,GPIO.HIGH)  #bottom
            GPIO.output(23,GPIO.LOW)
            GPIO.output(24,GPIO.HIGH)
            GPIO.output(5,GPIO.LOW)
            time.sleep(float(0.4))
            GPIO.output(22,GPIO.LOW)
            GPIO.output(23,GPIO.LOW)
            GPIO.output(24,GPIO.LOW)
            GPIO.output(5,GPIO.LOW)


    if(mymessage=="b'gora'"):
            print("GoRallent")
            GPIO.output(22,GPIO.LOW)  #Gorallent
            GPIO.output(23,GPIO.HIGH)
            GPIO.output(24,GPIO.LOW)
            GPIO.output(5,GPIO.HIGH)
            time.sleep(float(0.4))
            GPIO.output(22,GPIO.LOW)
            GPIO.output(23,GPIO.LOW)
            GPIO.output(24,GPIO.LOW)
            GPIO.output(5,GPIO.LOW)


    if(mymessage=="b'go'"):
            print("go no obstacle")
            GPIO.output(22,GPIO.LOW)  #go straight.
            GPIO.output(23,GPIO.HIGH)
            GPIO.output(24,GPIO.LOW)
            GPIO.output(5,GPIO.HIGH)
            
           


client = mqtt.Client()
client.on_connect = on_connect
client.on_message = on_message
client.will_set("raspberry/status",b'{"status":"off"}')
client.connect("broker.emqx.io",1883,60)

client.loop_forever()
           
    

Below Python script for send message-commands
with mqtt protocol from remote device.



#install in your remote device the mqtt library:
#pip3 install paho-mqtt
#create a profile in remote server broker: 
#https://mqttx.app/  or dowload the app
#List of remote server broker free in link below:
#https://github.com/mqtt/mqtt.org/wiki/brokers
#commads: arrow key for direction,
#backspace for stop, 
#n key for move the camera up,
#s key for move the camera frame down.
#install in your remote device the mqtt library:
#pip3 install paho-mqtt
#sudo pip3 install keyboard
#copy and paste below script in a file with 
#name mqtt.py and from terminal linux
#digit python3 mqtt.py and start to send 
#message command from your remote ubuntu device

import paho.mqtt.client as mqtt
import time
import keyboard
def stoppa():
       mqttc = mqtt.Client() 
              #chat=(input())
       mqttc.connect("broker.emqx.io", 1883, 60)  # Connect to (broker, port, keepalivetime)
       mqttc.loop_start()  # Start networking daemon
       mqttc.publish(".....", "stop") 
       mqttc.loop_stop()           
                             
while(1<2):
    while keyboard.is_pressed("s"):
              mqttc = mqtt.Client() 
              #chat=(input())
              mqttc.connect("broker.emqx.io", 1883, 60)  # Connect to (broker, port, keepalivetime)
              mqttc.loop_start()  # Start networking daemon
              mqttc.publish("........", "sud") 
              mqttc.loop_stop()
   


    while keyboard.is_pressed("n"):
    
              mqttc = mqtt.Client() 
              #chat=(input())
              mqttc.connect("broker.emqx.io", 1883, 60)  # Connect to (broker, port, keepalivetime)
              mqttc.loop_start()  # Start networking daemon
              mqttc.publish(".......", "nord") 
              mqttc.loop_stop()          
   
  
    while keyboard.is_pressed("up arrow"):
    
                              mqttc = mqtt.Client() 
               #chat=(input())
                              mqttc.connect("broker.emqx.io", 1883, 60)  # Connect to (broker, port, keepalivetime)
                              mqttc.loop_start()  # Start networking daemon
                              mqttc.publish("........", "go") 
                              mqttc.loop_stop()          
   
      
                                      
  
              
              
              
    while keyboard.is_pressed("down arrow"):
              mqttc = mqtt.Client() 
              #chat=(input())
              mqttc.connect("broker.emqx.io", 1883, 60)  # Connect to (broker, port, keepalivetime)
              mqttc.loop_start()  # Start networking daemon
              mqttc.publish(".......", "bottom") 
              mqttc.loop_stop()  
    
        
        
                       
    while keyboard.is_pressed("left arrow"):
              mqttc = mqtt.Client() 
              #chat=(input())
              mqttc.connect("broker.emqx.io", 1883, 60)  # Connect to (broker, port, keepalivetime)
              mqttc.loop_start()  # Start networking daemon
              mqttc.publish("......", "right") 
              mqttc.loop_stop()           
            
              
    while keyboard.is_pressed("right arrow"):
              mqttc = mqtt.Client() 
              #chat=(input())
              mqttc.connect("broker.emqx.io", 1883, 60)  # Connect to (broker, port, keepalivetime)
              mqttc.loop_start()  # Start networking daemon
              mqttc.publish(".....", "left") 
              mqttc.loop_stop()           
                     
              
        
        
    while keyboard.is_pressed("g"):
                 mqttc = mqtt.Client() 
              #chat=(input())
                 mqttc.connect("broker.emqx.io", 1883, 60)  # Connect to (broker, port, keepalivetime)
                 mqttc.loop_start()  # Start networking daemon
                 mqttc.publish("........", "go") 
                 
                 mqttc.loop_stop()           
                          
        
        
        
        
    while keyboard.is_pressed("space"):
    
                 mqttc = mqtt.Client() 
              #chat=(input())
                 mqttc.connect("broker.emqx.io", 1883, 60)  # Connect to (broker, port, keepalivetime)
                 mqttc.loop_start()  # Start networking daemon
                 mqttc.publish(".......", "stop") 
                 mqttc.loop_stop()     
                 
                       

cookies