@Eric-Katzfey Hi Eric, thanks for pointing this out. How would you go about establishing a serial communication with a Teensy or other microcontroller then?
Best posts made by Filip Slezak
-
RE: Communication through J18
Latest posts made by Filip Slezak
-
RE: Communication through J18
@Eric-Katzfey Hey, we already have this board on https://www.modalai.com/collections/expansion-board/products/m0078 - would that work?
(and the PWM breakout board https://www.modalai.com/products/flight-core-pwm-output-cable-and-break-out-board)
-
RE: Communication through J18
@Eric-Katzfey Hi Eric, thanks for pointing this out. How would you go about establishing a serial communication with a Teensy or other microcontroller then?
-
Communication through J18
Hi, I'd like to communicate with a teensy from a Voxl2 through the serial channel on J18. Can you help me set this up?
I tried UART first and then the I2C but I haven't figured this out. Here's my code
import smbus # Open the I2C bus bus = smbus.SMBus(0) # Use /dev/i2c-0 # I2C device address address = 0x988000 # Replace with the actual I2C device address # Read lines of data from the I2C device while True: received_data = "" while True: byte = bus.read_byte(address) if byte == ord('\n'): # Check for newline character break received_data += chr(byte) # Process the received data print("Received line:", received_data) # Close the I2C bus bus.close()
and the one I want to use on the teensy
#include <Wire.h> #define I2C_ADDRESS 0x42 // Replace with the I2C device address void setup() { Wire.begin(); // Initialize I2C communication Serial.begin(115200); // Set baud rate for serial monitor } void loop() { Wire.beginTransmission(I2C_ADDRESS); // Begin transmission to the I2C device Wire.write("Hello, World!"); // Send the message Wire.endTransmission(); // End transmission Serial.println("Message sent!"); delay(1000); // Wait for 1 second before sending the next message }
This is my first attempt at dealing with I2C so extra comments are welcome as well. Would still be easier if I could use these pins for UART so tell me if that's an option.
Thanks!
-
RE: Upgrading PX4 for VOXL2
@Eric-Katzfey Yeah ok I think I got it. So just execute the above dpkg install. Would be cool if it checked for updates itself every once in a while
-
RE: Upgrading PX4 for VOXL2
@Eric-Katzfey Is this just a command to execute on the voxl, px4 will be updated and all else remain equal - custom configs and all?
Thanks
-
RE: PWM and CAN channels
@Vinny Hi, is there any update on this CAN support through FlightCore V2?
We're seriously considering the option instead of a PWM through the I/O board to control our motors. Unfortunately, I can't seem to find any code that would do this from the PX4 pilot - other than that the connector exists. How is this supported by the board interfaces? How would I go about sending commands to that bus?
Let me know if you need more info.
Best -
RE: PWM channel control for auxiliary functions
Any tips on how to control this from ROS for offboard mode?
-
RE: PWM channel control for auxiliary functions
Yes, thanks. Although incomplete
Need to configurequad_x_io.main.mix
(find / -name "filename"
) with the code below where X is the channel defined in the 2nd link below (AUX1 5 or AUX2 6)# Hexacopter X airframe config R: 6x ... # For each AUX channel M: 1 S: 3 X ...
Writing this from home, sorry for '...' but simply copy the config to quad_x.main.mix to quad_x_io.main.mix, both these files are loaded on boot and if the io board is connected it overrides the former
AUX1 will be on pin7 and AUX2 on pin8.
- https://docs.px4.io/v1.12/en/concept/mixing.html
- https://docs.modalai.com/voxl2-io-user-guide/#supported-mixers-and-airframe-setup
Or properly rename the file and change the name being loaded in the px4 startup script but I didn't do that to avoid issues in case it's used by something else too...
-
RE: VOXL2 unused/repurposed GPIO
def gpio_init(pin): with open("/sys/class/gpio/export", "w") as config: config.write(str(pin).encode()) return def gpio_exit(pin): with open("/sys/class/gpio/unexport", "w") as config: config.write(str(pin).encode()) return def gpio_set_mode(pin, direction): with open("/sys/class/gpio/gpio{}/direction".format(pin), "w") as mode: mode.write(str(direction).encode()) return def gpio_set_value(pin, value): with open("/sys/class/gpio/gpio{}/value".format(pin), "w") as gpio: gpio.write(str(value).encode()) return
-
PWM channel control for auxiliary functions
Hi all,
How should I go about controlling the PWM channel 7 or 8 (hexacopter airframe) from VOXL2 code and/or remote control? I can't find where the AUX channels are mapped
Thx