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
    216
    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.
    • José QuintanillaJ
      José Quintanilla
      last edited by

      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?

      tomT 1 Reply Last reply Reply Quote 0
      • tomT
        tom admin @José Quintanilla
        last edited by

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

        José QuintanillaJ 1 Reply Last reply Reply Quote 0
        • José QuintanillaJ
          José Quintanilla @tom
          last edited by

          @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

          tomT 1 Reply Last reply Reply Quote 0
          • tomT
            tom admin @José Quintanilla
            last edited by

            @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?

            José QuintanillaJ 1 Reply Last reply Reply Quote 0
            • José QuintanillaJ
              José Quintanilla @tom
              last edited by

              @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
              • First post
                Last post
              Powered by NodeBB | Contributors