Categories
Mastering Development

Multiple functions within single Python Script

So far when creating python functions, I’ve been keeping them separate, i.e. a single function with parameters passed to it. I would like to have a single python script with multiple functions and be able to pass different parameters to each one #Import Serial import serial #Import Time import time #Import Sys import sys def […]

Categories
Development

How to reduce time spent by ‘readline()’ from serial data

I am trying to make a function to get the gyroscope components X,Y,Z from a sensor. The function is the following: def bimu_get_gyroscope_raw(): #ser = serial.Serial(‘/dev/ttyUSB0’, 115200, timeout=15) ser = serial.Serial(‘/dev/tty.usbserial-00002014’, 115200, timeout=15) ser_io = io.TextIOWrapper(io.BufferedRWPair(ser, ser, 1), newline = ‘\r’, line_buffering = True) try: ser.isOpen() print(‘serial is open’) except: print(‘error_1’) exit() #——————– i = […]

Categories
Development Linux

How to configure X11 for embedded i.MX6 board with touchscreen?

I plan to run an Electron app on my UDOO Neo i.MX6 board with the official st1232 7” touchscreen kit for UDOO Neo. I created a custom Linux distro with Poky (thud branch) to be able to build a “ready to boot” image. I enabled the “x11-base” image feature to have all the Xorg packages […]

Categories
Development

How to increase speed and split data with multiple plots using PyQtGraph?

I am reading datas from serial port using an STM32 kit. Problem is that I need to use own timestamp for plot ADC datas. That is mean x-axis should be my RTC time(using ms for this) and y-axis is ADC datas. There are programs for plot serial port but as I said I need to […]

Categories
Development

Send data with serial port

I want to program a rolling base. The connection of TX, RX, and GND of the base is with rs232, but I haven’t this port on my laptop. So I’m using an adaptor USB-RS232. The connection works because when I enter the different commands in Putty, the robot moves. So in visual studio, I create […]

Categories
Development

Using Pyserial, why would a delay be required between the time that a Serial class is instantiated and the Serial object being used to write data?

Solved: It seems that after instantiating the class which opens the port, it takes approximately 1 second for the board to boot up before data can be wrote. I’m uncertain if there is any way around this though. Original Question: I have a basic script that sends G-Code to an Einsy Retro printer controller board […]

Categories
Development

QEMU MIPS32 – 16550 Uart Implementation on a Custom Board

I’m trying to use QEMU to emulate a piece of firmware, but I’m having trouble getting the UART device to properly update the Line Status Register and display the input character. Details: Target device: Qualcomm QCA9533 (Documentation here if you’re curious) Target firmware: VxWorks 6.6 with U-Boot bootload CPU: MIPS 24Kc Board: mipssim (modified) Memory: […]

Categories
Development

Init process(PID 1) has no outputs after I changed the rootfs format from jffs2 to ramfs [on hold]

Hardware: ARM arch development board Marvell A385 CPU. Software: Linux kernel 3.10, rootfs is implemented by busybox. Before this, I saved kernel, dtb and rootfs on NAND flash, when it boots, uboot will read kernel, dtb to RAM, then set bootargs to tell kernel where is the rootfs. So kernel will find rootfs in defined […]

Categories
Development

Unable to read data from serial port

I tried to read data from USB port on OSX using pyserial. When I tried to read it using CoolTerm, everything worked fine. This is the configuration: Then I tried to write a short script which doesn’t continuously output the data (it outputs the data only once and the even if I restart the script, […]

Categories
Development

Data from serial port comes in a vertical format

I’ve a python script that is reading from a serial port (TXRX) using a barcode scanner, everything works well, but my issue when text comes in from the serial port comes in a vertical format, something like this: if the barcode that I am reading has 123456, it comes in my python script as: 1 […]