meloncookie / RemotePy

This is an infrared remote control send / receive library by micropython.
MIT License
22 stars 3 forks source link

GUI Demo, unplugging for each record and unable to save. #1

Closed Vendelator closed 2 years ago

Vendelator commented 2 years ago

Awesome project, this is the closest iv'e come to controlling my AC so far...

When using GUI, the raspberry pi pico needs to be unplugged between each recording. The file naming can't be .json but works well when its .py, both opening and creating new.

I am unable to Send any data from the IR Transmitter using the GUI and i am prompted with the error "Can't connect device.". When not using the GUI, The IR Receiver reacts to something being sent, but nothing is triggered on my AC unit.

Code in Thonny:

from machine import Pin
from UpyIrTx import UpyIrTx
from UpyIrRx import UpyIrRx

rx_pin = Pin(16, Pin.IN)   # GPIO16
rx = UpyIrRx(rx_pin)

tx_pin = Pin(19, Pin.OUT)  # GPIO19
tx = UpyIrTx(0, tx_pin)    # 0ch
...
# If the remote control is transmitted to the receiving circuit
# within 3000 msec, the remote control signal is acquired.
start = input()
rx.record(3000)
if rx.get_mode() == UpyIrRx.MODE_DONE_OK:
    signal_list = rx.get_calibrate_list()
    # ex) [430, 1290, 430, 430, 430, 860, ...]
else: ### This is AC - Auto Mode, 16 DegC, No Swing, Auto Fan ###
    signal_list = [8832, 4416, 552, 1656, 552, 1656, 552, 552, 552, 552, 552, 552, 552, 552, 552, 1656, 552, 1656, 552, 1656, 552, 1656, 552, 1656, 552, 552, 552, 552, 552, 552, 552, 1656, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 1656, 552, 1656, 552, 1656, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 1656, 552, 552, 552, 1656, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 1656, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 1656, 552, 552, 552, 1656, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 552, 1656, 552, 1656, 552, 1656, 552, 1656, 552, 552, 552, 2208, 552, 1104, 0, 2208, 552] 
print (signal_list)
...
if signal_list: # Returns Bool, meaning if True
    #print(tx.send(signal_list))
    tx.send(signal_list)
    print ("Its done")
...

Purple - 3v3 Grey - Ground White - GPIO 19 and 16 image Transmitter https://www.electrokit.com/uploads/productfile/41015/41015733_-_IR_Transmitter_Module.pdf Receiver https://www.electrokit.com/uploads/productfile/41015/41015734_-_IR_Receiver_Module.pdf

meloncookie commented 2 years ago

Thank you for using it. I'm not good at English, so please forgive me if I don't understand enough.

"Can't connect device."

Since it was written for M5Stack ATOM (Lite, Matrix), it is necessary to rewrite a part of communication.py. See the readme for details.

--- Modify communication.py --- class Communication(): _DEFAULT_VID = 11914 # <-- this _DEFAULT_PID = 5 # <-- this

needs to be unplugged between each recording

Sorry... I couldn't understand the reason : "unplugged between each recording". Is USB communication not working well?

IR Receiver reacts to something

Even if send signal, the air conditioner doesn't work, right? But is it possible to receive with the receiving module? If so, I think it is the limit of this transmission module. Optimized for 5V operation in this board, the LED current may be insufficient at 3.3V. If the LED current is small, it will not fly at all. Try sending from a very short distance on the air conditioner. If so, modify the circuit. Or is UpyIrRx not working well?

I hope it helps you even a little.

Vendelator commented 2 years ago

This is not an issue from what i can tell. I have edited my files as your suggest in your guide and in your reply.

I think you are correct in your assumption on insufficient power. I have gotten a lot closer and am now closing this thread.

Ongoing progress is found here: https://github.com/meloncookie/RemotePy/issues/3#issuecomment-1188156227