• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Register
  • Login
ModalAI Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
    • Register
    • Login

    Can I send data through the j1006 port and read it with python?

    Ask your questions right here!
    2
    5
    302
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      José Quintanilla
      last edited by 25 Oct 2023, 02:32

      I currently made a code to emulate a distance sensor, and I can read the usb port of my laptop to get the data of a nodemcu and a potentiometer, I want to try this inside the drone, so I can see if using a ultrasonic sensor is viable, I don't have the necessary cable at the moment to connect the nodemcu to the J10 port that has i2c and uart communication
      this is my code

      import serial
      ser = serial.Serial('/dev/ttyUSB0')
      print(ser.name)
      
      while True:
       line = ser.readline()
       decoded_data = line.decode('utf-8')
       print(decoded_data)
      

      Does anyone know if this would work?

      T 1 Reply Last reply 25 Oct 2023, 17:04 Reply Quote 0
      • T
        tom admin @José Quintanilla
        last edited by 25 Oct 2023, 17:04

        @José-Quintanilla What hardware are you using? voxl1 / voxl2 / flight core v1 / flight core v2, etc.

        J 1 Reply Last reply 25 Oct 2023, 23:47 Reply Quote 0
        • J
          José Quintanilla @tom
          last edited by 25 Oct 2023, 23:47

          @tom the one included with m500 i think is the flight core v1, I'm currently using the expansion board that was included with the drone and I was able to detect the usb port, but know I need to install the serial library in the drone but I don't know how to install python libraries

          T 1 Reply Last reply 26 Oct 2023, 00:12 Reply Quote 0
          • T
            tom admin @José Quintanilla
            last edited by 26 Oct 2023, 00:12

            @José-Quintanilla depending on how old your M500 is, it could have a FCv1 or a FCv2.

            Are you trying to plug your hardware into the flight core (STM) side or the voxl (apq8096) side of the drone?

            J 1 Reply Last reply 26 Oct 2023, 00:54 Reply Quote 0
            • J
              José Quintanilla @tom
              last edited by 26 Oct 2023, 00:54

              @tom I was able to pug the hardware to the expansion board that goes to the j13 port of the voxl flight,

              lsusb the one im using is the Bus 001 Device 002: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter

              Screenshot from 2023-10-25 18-45-49.png

              the success connection of the hardware
              conection_succes.jpeg

              the setup

              setup.jpeg

              1 Reply Last reply Reply Quote 0
              1 out of 5
              • First post
                1/5
                Last post
              Powered by NodeBB | Contributors