Is there a way I can hack somehow an xbox controller to send custom signal or clone the protocol with a usb dongle.
Basically a way I can use my pc as a controller for xbox console.
I am trying to develop an AI that plays FIFA and all the processing is made on PC. I can't find how to send the signal, corresponding to the action the AI has decided to make, to the xbox console.
Thank you in advance
No, xbox controller wireless protocol is proprietary and nobody reverse-engineered it yet AFAIK.
To use a real xbox wireless controller on a PC (the opposite of what you want) you need an adapter, which is sold separately, and most USB XBOX code we have published is dedicated to make those adapters work on linux. The actual protocol of wireless communication between the adapter and the controller is a mystery. It is not normal wifi so you can't use any wifi adapter available in the market to mimic it.
Another option is to crack open an xbox controller and connect the components (using arduino maybe?) directly to the PC.
There's a work around solution to your problem. The Xbox app for Windows allows you to play games via streaming over a local network. The quality is imperfect, but if you have access to the console's actual video output you can set the stream quality to the lowest setting to minimize latency.
Streaming via the Xbox app for Windows will allow you to emulate a controller via any of a number of methods that convert various signals to X-input. I personally have tested this with a Dual Shock 4 controller and InputMapper. For your purposes, you may want to try EventGhost.
People shouldn't just throw shade automatically because you're designing a bot. There are plenty of respectable reasons for doing so, particularly academic ones. I hope you're not just trying to cheat, but if you are, it's an impressive way of going about it, at least.
Related
A bit of background on my project: I am doing a robot which can be controlled through the internet with live video feed. For that I have a raspberry pi as an on-board computer that handles the internet connection, video streaming, motor controlling etc. I've been successful with controlling it through a socket connection on python and a public VPS to relay commands (for NAT traversal).
Now I want to implement some sort of "idle state" like you would have on a mobile phone: The robot would stays idle and consume almost no power, and when I initiate a call on my computer it would wake up, stream the video etc. and when I hang up the call it would go to sleep again. Essentially, I want some version of Apple's Facetime and tweak it to my liking. The emphasis is on consuming as little energy as possible, since the robot is battery powered.
I can find almost no information on the internet for such an implementation (or maybe I just don't know the correct keyword). Can anyone point me in the correct direction?
newbie here.
I work in a factory that produce electric cables.
I'm trying to build a web application that will handle production processes. For this i need some real time data. There are multiple types of machines , some of them are older and uses a lot of digital counters like this on: https://mirror2.mixtronica.com/42248-superlarge_default/h7cx-aud1-n-contador-omron.jpg . Some of them are newer and have plc's ( siemens s7-1200 , s7-1500 and others ).
I have 0 experience with plc and plc programming. From what I saw from my research is that newer plc like s7 have a option "WEB SERVER", if that's enables i may be able to send data from counters and other stuff to a web page that is automated generated from that option. Folks on the internet uses software like Tia Portal to connect to them. My question is : if i try to connected at them with TIA-PORTAL and ethernet cable is there any possibility that i will corrupt something ? Tia-portal will recognize the program that's running (it was not uplouded by me ) ?
Is there any way that i can make that digital counters transmit data on a raspberry pi or similar device. If not , what are my options there , is there any product intergrated with iot that i can use ?
I also have some industrial scales but those have rs 232 interface and that was prrety smooth to make them talk with my pi.
From what I understand you want to read and send data to the machines, correct? Because there are some simpler approaches than having to build an IoT application from scratch.
Recently I've been studying solutions like this and the best alternative I've looked at is using Thingsboard (which can be installed locally or using the remote platform) or other platforms like Losant... This avoids creating a lot from scratch (storing data, create charts...), however, in a way, is limited in a few things and a gateway may be needed to handle the conversion of data from devices to platform. I'm still learning how to use it, but I think it's worth leaving it as a tip if your case is more about collecting and dislay data or creating simple actions or logic.
About connecting the devices:
For machines with PLC I recommend that you research OPC-UA or MQTT, they are protocols that will facilitate communication and it seems that these versions of the Siemens S7 have OPC-UA.
For machines without PLC and without any communication port you may be forced to install a "gateway", an Arduino, ESP32 or another Raspberry PI may facilitate things, or even a small PLC, to collect the discrete data and convert them to Modbus, MQTT, OPC-UA, or another way that you can send it to your server... The concern here would be with electromagnetic interference, but that will depend on your equipment (with industrial equipment validated as a PLC you won't have these problems).
This is not a complete answer, but I believe it will help you to develop the solution :)
I'm on a team working on a non-profit, open-source project and we're creating a web-based configuration tool to control a piece of custom hardware on a Raspberry Pi, using the "Web Bluetooth API".
Packets over the BLE connection are limited to 512 bytes, so we seem to need a transfer protocol layer to assist communication with the Pi.
We do not want a UART implementation, as we want transmission guarantees.
Does such a transfer protocol layer exist, ideally implemented in Python?
Or is there a simple way to generate a python implementation of a transfer protocol layer, that would work with 512byte packages?
Your question is a little too broad to be able to give any kind of specifics.
The official profiles that are available with Bluetooth are documented at: https://www.bluetooth.com/specifications/specs/
Custom services can be created fairly easily if you have control over both ends of the Bluetooth link. The Nordic UART Service is one that appears to be quite common and there are various apps around that understand it to make testing of your peripheral easier.
Creating a custom service that minimises the amount of data sent over the Bluetooth link is usually the goal. There are various guides around that can help.
One of the better guides for creating a Bluetooth Peripheral with BlueZ and Python, is this one https://punchthrough.com/creating-a-ble-peripheral-with-bluez/
There are also Python examples in the BlueZ source tree
And for completeness the BlueZ API's are documented at: https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc
first sorry if this is a simple question but I can't figure this out. I have this development board and on page 19 on the kits user guide the block diagram shows a RS232 line and on page 20 and 22 the schematic show the pins I need to connect to use RS232. My problem is that, despite being able to configure the fpga/cpld, I cannot find the com port on my computer (using pyserial and the following code(I tried changing COM%s in line 15 to FTUSB-%s)). So my questions are:
What interface does the FTDI, ft2232h USB to UART/FIFO, chip use (Serial, parallel... ) on the computer's end (like arduino's virtual COM port)?
On lattice's software there are 3 options to program the device. the program shows the following: HW-USBN-2b (FTDI) (with port as FTUSB-0), HW-USBN-2b (with port as ezUSB-0) and HW-DLN-3C. How can I use either of them to communicate with the device outside of Lattice's software?
thanks for you time.
1) RS232 is a combination of UART with certain voltage levels for the high and low (i.e. +3 to +15V and -3 to -15V afaik. Never ever connect a RS232 adapter to standard 3.3V or 5V devices e.g. UART, TTL-UART etc. The Lattice Semiconductor document just plainly missuses the term RS232 - try not to fall for it (IMHO the performance of their products strongly anticorrelates with the quality of their documentation and support).
2) page 19 of the linked doc shows the sections: Ordering Information, Technical Support Assistance, Revision History. Shifted by one page?
3) The FT2232H can be used in multiple modes. This depends on the way how it is addressed and of the settings flashed to the EEPROM connected to it (on the dev board is one placed but the FT2232H can be used without as well). The dev board is in the standard configuration designed to be programmed via the JTAG pins and the FT2232H is opened via the D2XX driver by lattice diamond. For that reason they flashed the EEPROM with settings which prohibits the use as virtual com port. The FTDI flash software can be used to change that behavior - for each bank seperately.
4) The solder bridges can be used to rearrange the connections (e.g. if one wants to change from the JTAG interface to the SPI or I2C programming interface). In your case you most likely want to place bridges on R14 and R15 to make the proper connection for an UART link to the port B of the FT2232H. EDIT: This way Port A can be used in JTAG mode to program the FT2232H and port B to communicate via e.g. UART or even other modes like the fast opto or the parallel bus/FIFO - if the correct bridges are soldered. Changing the EEPROM settings might be still required to make Port B visible as VCP if one want to avoid the usage of the D2XXX driver.
Most things were said in the previous reply, but here again in a slightly different way. This is what you need to prepare the use of an UART connection to the FPGA, but still needs any generic UART module configured into the FPGA after that:
This was tested on the Lattice MachXO3D development board, but I crosschecked that at least this part with the pins is the same with the MachXO3L board that you linked:
First, you need to bridge (solder) resistors R14 and R15 to connect UART RX and TX pins from the FTDI to the FPGA. You can use 0 Ohm resistors or just do it with solder tin, they are close enough for that. After that, FPGA pins/sites C11(=Tx) and A11(=Rx) can be used for your UART inside the FPGA, that you probably have as a Verilog/VHDL design. You find this information by looking at the "Appendix A. Schematics" of the user guide.
Additionally, something that was at least needed for the MachXO3D is to reconfigure the FTDI chip with FTDI's "ftprog" software. Not sure if it is needed for the MachXO3L, but it is easy to check and causes no harm:
Run "ftprog". Search/Parse for your FTDI chip and find the configuration for "Port B", and change "Hardware" from "245 FIFO" to "RS232 UART", and "Driver" from "D2XX" to "Virtual COM port". Then the second of the two ports you get from the FTDI chip (COM# in Windows, /dev/ttyUSB# in Linux; # being a number) should be usable through some virtual terminal software, use with python-serial, etc.
In Linux, the ftdi_sio kernel module has to be unloaded (sudo modprobe -r ftdi_sio) for Lattice Diamond to be able to program the FPGA, and after that loaded again (sudo modprobe ftdi_sio), to be able to use the respective /dev/ttyUSB# device. In Windows it doesn't need that and just works with python using COM#. Any suggestion to make this easier in Linux is also welcome!
In any case, as already said, you still need the respective UART module programmed in the FPGA and connected to the respective sites to be able to use it.
Update: I found that at a very obscure location, Lattice also documented a part of this, which is the User Guide to their Propel SDK. You can find the information starting Page 39 there: Lattice Propel SDK 2.0 User Guide
I am working on a student project involving a drone which runs on the Pixhawk platform but has a 'companion computer' in the form of a Raspberry Pi. The Pi runs its own Python software and uses DroneKit (and therefore MAVLink?) to communicate with the Pixhawk via USB - giving it commands, transferring data and so on. Additionally, we have a 'ground station' laptop running ArduPilot Mission Planner which can view and interact with the aircraft remotely and also view it's telemetry. I noticed a 'Messages' tab which essentially acts like a remote console, showing 'logged' messages from the Pixhawk - this is what the question is referring to.
For debugging and information purposes, I would like to be able to add to this from Python on the Pi. I assumed this would be easily achievable through DroneKit but it does not seem trivial - send_mavlink and message_factory looked hopeful but I have found nobody else trying to do this specifically.
How can I easily redirect my 'console messages' from Python to the ground station? I realise there are alternative methods but going through the Pixhawk's existing telemetry system seems a much better option.
Thanks
One thing you can do is to create a bridge (proxy) between Pixhawk and GCS with your RPi, similar to this question.
Then in the middle of that you can send your own text messages with:
gcs_conn.mav.statustext_send(mavutil.mavlink.MAV_SEVERITY_INFO, "your message here")
Be careful not blocking too much the telemetry transmission, otherwise you could have intermittent connection to the drone from your GCS.