Hello everyone! I'm new using my UDOO Neo (Full) and I would like to send a telegram or whatsapp message to my mobile. Does anyone know how to do this? I've found this https://github.com/witnessmenow/Universal-Arduino-Telegram-Bot but it seems it works with an Arduino chip that my UDOO Neo doesn't have (ESP8266). Any ideas?
Just use the Linux side of the Neo to send the message. Look for Raspberry Pi examples and the will most likely also work with Udoo Neo. If needed let the Arduino side send a trigger to the Linux side to send the message. Examples how the Linux side can communicate with the Arduino side can be found here https://www.udoo.org/docs-neo/Serial_Libraries/index.html Look also to the examples in my signature
Hello @waltervl , I think I've got it but it's not working and I don't know why, could you please take a look? Here's my arduino code Code: const int buttonPin = 2; // the number of the button pin const int ledPin = 13; // the number of the led pin int buttonStatus = 0; // variable for reading the button status void setup() { // initialize serial communication: Serial.begin(115200); delay(100); pinMode(ledPin, OUTPUT); pinMode(buttonPin, INPUT); } // the loop routine runs over and over again forever: void loop() { while ( Serial.available() > 0 ) { buttonStatus = digitalRead(buttonPin); if (buttonStatus == HIGH) { digitalWrite(ledPin, HIGH); // turn the LED on (HIGH is the voltage level) delay(1000); // wait for a second. Serial.print(buttonStatus); // If LED stays high longer you have serial timeout digitalWrite(ledPin, LOW); // turn the LED off by making the voltage LOW } else { digitalWrite(ledPin, LOW); } delay(10000); // wait for a 10 seconds to prevent buffer overflow } } And this is my phyton script Code: #!/usr/bin/env python # This program sends a Telegram message using Phoenix_timbre_bot when the Arduino button is pressed # Then run as sudo python timbre.py import time import requests import serial sleep = 16 # how many seconds to sleep between posts to the channel, API limit min 15 sec button_str = '0' DEBUG = False # set to True to get more debug prints in the Python console #Create serial device for reading serial arduino = serial.Serial('/dev/ttyS1',115200,timeout=1) arduino.flushOutput() arduino.flushInput() serial_buffer = "" line = "" #init for arduino so Arduino knows it can send data. arduino.write("I\n") def ReadArduino(arduino_out): global serial_buffer, line arduino_out = "" serial_data = arduino.read() # Read 1 character while serial_data: # If there is a character proceed serial_buffer += serial_data # Add character to buffer if DEBUG: print "ReadArduino:Serial buffer:",(repr(serial_buffer)) # if there is a new line in it, then create Line string if "\r\n" in serial_buffer: if DEBUG: print "ReadArduino:New Line:",(repr(serial_buffer)) line = serial_buffer serial_buffer = "" # empty Serial buffer serial_data = arduino.read() # if there is a Line string then finish reading the Line if line: # strip string for unwanted characters line = line.replace("\r\n", "") arduino_out = line if DEBUG: print "ReadArduino:arduino_out:", arduino_out line = "" if arduino_out == "": arduino_out = None # add the last character to the new buffer serial_buffer += serial_data return arduino_out def telegram_bot_sendtext(bot_message): bot_token = '{ here goes my bot token }' channel_chatID = '{ here goes my channel id }' send_text = 'https://api.telegram.org/bot' + bot_token + '/sendMessage?chat_id=' + channel_chatID + '&parse_mode=Markdown&text=' + bot_message response = requests.get(send_text) return response.json() def verificar_timbre(): global button, button_str while True: #read arduino data and make it a integer value button_str = ReadArduino(button_str) if button_str is None: button_str = '0' button = int(button_str) if button == 1: telegram_bot_sendtext('Est??n tocando el timbre') if __name__ == "__main__": while True: verificar_timbre() time.sleep(sleep) Also I'm doing in the console sudo ln -s /dev/ttyMCC /dev/ttyS1 What I´m doing wrong? Thanks!
So what is not working then? No messages in python console?? LED is not flashing? Perhaps add some extra logging for debugging. Be sure the python script runs before you press a button on the Arduino.
The messaging feature on whatsapp gb won't ask for those things. Are all supported on the app's home page