Asked

Sending Data Wirelessly To An ARC Python Script

Hi Athena,

I am interested in transmitting data wirelessly using Wi-Fi, Bluetooth Low Energy (BLE), or Bluetooth from an Arduino device and/or an application on my Android phone. My goal is to have this data accessible within a Python script that I am executing through the scripting interface in Synthiam ARC. Is this functionality supported? If so, could you provide guidance on how to implement this setup?

Thank you in advance for your assistance.

Best regards,
Satish


Related Hardware Arduino Genuino Uno

ARC Pro

Upgrade to ARC Pro

Unleash your creativity with the power of easy robot programming using Synthiam ARC Pro

PRO
Canada
#1  

Hello Satish,

Yes, you can transmit data wirelessly to an ARC Python script using Wi-Fi, Bluetooth Low Energy (BLE), or Bluetooth from an Arduino device or an Android phone. Here's a general guide on how to implement this setup:

Using Wi-Fi:

  1. Wi-Fi Module for Arduino:

    • You can use a Wi-Fi module like the ESP8266 or ESP32 with your Arduino Uno to send data over Wi-Fi.
    • Program the Arduino to connect to your Wi-Fi network and send data to a server or directly to ARC if it supports network communication.
  2. ARC Network Communication:

    • Use the Net.hTTPGet() or Net.hTTPPost() functions in ARC to receive data from the Arduino.
    • Ensure your Arduino is set up to send HTTP requests to the ARC's IP address and port.

Using Bluetooth:

  1. Bluetooth Module for Arduino:

    • Use a Bluetooth module like the HC-05 or HC-06 with your Arduino Uno.
    • Pair the Bluetooth module with your computer running ARC.
  2. ARC COM Port Communication:

    • Use the COM functions in ARC to read data from the Bluetooth COM port.
    • For example, use COM.readAllText(port) to read data sent from the Arduino.

Using Bluetooth Low Energy (BLE):

  1. BLE Module for Arduino:

    • Use a BLE module like the HM-10 with your Arduino Uno.
    • Pair the BLE module with your computer running ARC.
  2. ARC COM Port Communication:

    • Similar to Bluetooth, use the COM functions in ARC to read data from the BLE COM port.

Python Script in ARC:

  • Once the data is received in ARC, you can use a Python script to process it.
  • Use the getVar() and setVar() functions to manage data between different robot skills and scripts.

Example Python Script:

# Example of reading data from a COM port
port = "COM3"  # Replace with your actual COM port
if COM.isPortOpen(port):
    data = COM.readAllText(port)
    print("Received data:", data)
else:
    print("COM port is not open.")

Additional Resources:

Please let me know if you need further assistance or specific examples for your setup. I'm here to help!

Best regards, Athena


I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.