Thursday, March 23, 2023

Notes on Getting Python to Talk to FTDI FT232 chipset for USB Serial Communication

NOTE: This is incomplete and is nothing more than just notes for myself. It is not yet part of a complete solution and I don't fully understand all the consequences that may be involved. Follow at your own risk.

To get python to talk to FTDI FT232 chip for USB Serial Communication (Windows)

Replace the existing FTDI Driver with libusb-win32 using Zadig (Reference

Now the device shows up when searched for using VID and PID:

import usb
import usb.util
print(usb.core.find(idVendor=0x0403, idProduct=0x6001))


It WILL NO LONGER list under:

import serial.tools.list_ports

# List all available COM ports
ports = list(serial.tools.list_ports.comports())

# Print information for each port that is currently in use
for port in ports:
    if port.pid is not None and port.vid is not None:
        print(f"Port: {port.device} - VID: {hex(port.vid)} - PID: {hex(port.pid)} - Description: {port.description}")


but now pyftdi can now connect using VID and PID:

import time
from pyftdi.ftdi import Ftdi, FtdiError

try:
    ftdi = Ftdi()
    ftdi.open(vendor=0x403, product=0x6001)

    while ftdi.is_connected:
        try:
            ftdi.poll_modem_status()
            status = ftdi.modem_status()
            print(status)
        except FtdiError:
            break
        time.sleep(0.1)

finally:
    ftdi.close()

Sunday, March 19, 2023

Unreal Engine 5 Development Resources

These are some very helpful resources I've compiled for getting started with UE5 development (especially if you don't have strong C++ experience).


If things aren't working or aren't building properly, close your code editor and Unreal editor delete Binaries and Intermediate in the project directory, and relaunch Unreal. (This has solved issues where Hot load modules prevented Live Coding to not work, and when an OnComponentHit callback wasn't being called. 



UE5 Quick Start:

https://docs.unrealengine.com/5.1/en-US/programming-with-cplusplus-in-unreal-engine/ 


UE5 General Development Info:

https://landelare.github.io/2023/01/07/cpp-speedrun.html 


Titled: Unreal Engine C++ Complete Guide:

https://www.tomlooman.com/unreal-engine-cpp-guide/


UE5 API:

https://docs.unrealengine.com/5.1/en-US/API/

This may feel slightly under documented, as it fails to provide excess explanations, but it does include quite a bit that helps including which modules you need to include, which headers, and the general signature to methods. 


UE Slackers Common Problems:

https://tackytortoise.github.io/2022/06/24/common-slacker-issues.html

This is great for understanding why you are getting the errors you get. 


Unreal Engine 5 C++ Developer: Learn C++ & Make Video Games (Paid)

https://www.udemy.com/share/101XRs3@llGSC49Ky7ZvQwnidnkhWJW9NRkaKYBIB2IGLmMvqJjf20O10FSa1vZaPLD-dCK0/

I don't know if I benefit or not from the link, but either way this course is a great primer into UE game engine development and C++ (even if you are not very familiar with either). This is a paid resource, but wait for it and it will go on sale for like $20 -- although it is probably fair at $110 for how much you get our of it. (I paid about $20 and it was worth every penny).