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

Source: https://forum.modalai.com/topic/2770/can-i-send-data-through-the-j1006-port-and-read-it-with-python
Category: General Questions (https://forum.modalai.com/category/2/general-questions)
Posted: 2023-10-25 02:32:59 UTC by José Quintanilla
Replies: 4 · Views: 1034

## José Quintanilla · 2023-10-25 02:32:59 UTC

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?

## Reply by tom (ModalAI staff) · 2023-10-25 17:04:26 UTC

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

## Reply by José Quintanilla · 2023-10-25 23:47:29 UTC (in reply to tom)

@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

## Reply by tom (ModalAI staff) · 2023-10-26 00:12:20 UTC (in reply to José Quintanilla)

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

## Reply by José Quintanilla · 2023-10-26 00:54:05 UTC (in reply to tom)

@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](https://forum.modalai.com/assets/uploads/files/1698281173198-screenshot-from-2023-10-25-18-45-49.png) 

the success connection of the hardware
![conection_succes.jpeg](https://forum.modalai.com/assets/uploads/files/1698281636465-conection_succes.jpeg) 

the setup

![setup.jpeg](https://forum.modalai.com/assets/uploads/files/1698281643642-setup.jpeg)
