Matsemann / mDjiController

Connect your DJI Remote Controller to your computer and use it to play simulators
Apache License 2.0
87 stars 30 forks source link

Hello, i have an error in your code #12

Open Tuburni opened 1 year ago

Tuburni commented 1 year ago

Exception has occurred: AttributeError 'socket' object has no attribute 'write' File "C:\Users\User\Downloads\DJI_RC-N1_SIMULATOR_FLY_DCL-master\DJI_RC-N1_SIMULATOR_FLY_DCL-master\main.py", line 125, in send_duml s.write(packet) ^^^^^^^ File "C:\Users\User\Downloads\DJI_RC-N1_SIMULATOR_FLY_DCL-master\DJI_RC-N1_SIMULATOR_FLY_DCL-master\main.py", line 189, in send_duml(s, 0x0a, 0x06, 0x40, 0x06, 0x24, bytearray.fromhex('01')) AttributeError: 'socket' object has no attribute 'write'

Matsemann commented 1 year ago

Hi, sounds like it's a different project you're using, as there is no python code in my repo. Looks like you're using the code from here: https://github.com/IvanYaky/DJI_RC-N1_SIMULATOR_FLY_DCL


Cool project, @IvanYaky , I added a link to it from my readme :)

Tuburni commented 1 year ago

Ok, maybe your project will work with remote from DJI Mavik 3?

Matsemann commented 1 year ago

This project only works for the old DJI (like, 10 years old). For other version see here: https://github.com/Matsemann/mDjiController#mdjicontroller

ivnny commented 1 year ago

@Matsemann Hi, thanks

@Tuburni https://github.com/IvanYaky/DJI_RC-N1_SIMULATOR_FLY_DCL works great with Mavic 3 rc-n1(rc23 ) on Windows 11 but it's easy could be modified for Linux

Xmen-ua commented 1 year ago

@Tuburni https://github.com/IvanYaky/DJI_RC-N1_SIMULATOR_FLY_DCL отлично работает с Mavic 3 rc-n1(rc23) в Windows 11, но его легко модифицировать для Linux.

Hi, I have problem in run emulator. Traceback (most recent call last): File "C:\dji\main.py", line 13, in <module> gamepad = vg.VX360Gamepad() File "C:\Users\Xmen\AppData\Local\Programs\Python\Python311\Lib\site-packages\vgamepad-0.0.8-py3.11.egg\vgamepad\win\virtual_gamepad.py", line 115, in init super().init() File "C:\Users\Xmen\AppData\Local\Programs\Python\Python311\Lib\site-packages\vgamepad-0.0.8-py3.11.egg\vgamepad\win\virtual_gamepad.py", line 60, in init assert vcli.vigem_target_is_attached(self._devicep), "The virtual device could not connect to ViGEmBus." AssertionError: The virtual device could not connect to ViGEmBus.

IvanYaky commented 1 year ago

@Xmen-ua Please try this:

  1. pip uninstall vgamepad, and install it again: pip install vgamepad (I tested on vgamepad 0.0.8)
  2. If no effect try to remove and reinstall package ViGEmBUs, https://github.com/ViGEm/ViGEmBus/releases
IvanYaky commented 1 year ago

Exception has occurred: AttributeError 'socket' object has no attribute 'write' File "C:\Users\User\Downloads\DJI_RC-N1_SIMULATOR_FLY_DCL-master\DJI_RC-N1_SIMULATOR_FLY_DCL-master\main.py", line 125, in send_duml s.write(packet) ^^^^^^^ File "C:\Users\User\Downloads\DJI_RC-N1_SIMULATOR_FLY_DCL-master\DJI_RC-N1_SIMULATOR_FLY_DCL-master\main.py", line 189, in send_duml(s, 0x0a, 0x06, 0x40, 0x06, 0x24, bytearray.fromhex('01')) AttributeError: 'socket' object has no attribute 'write'

I suggest installing pyserial pip3 install pyserial

Xmen-ua commented 1 year ago

@IvanYaky reinstalled ViGEmBUs, only 1.16.116 work in my case. Thanks for the help!

K0KA0 commented 9 months ago

Hi, when I run the file it closes immediately, I tried to start it via IDLE so it said:```

= RESTART: S:\miniDjiController-master\main.py
Traceback (most recent call last):
  File "S:\miniDjiController-master\main.py", line 6, in <module>
    import serial, pyvjoy, argparse
ModuleNotFoundError: No module named 'serial'

What should i try? P.s: Use Mavic Mini RC