Serial com ports rs-232 / USB HID lua modules

Plugins y todo lo relacionado para Autoplay Media Studio.
Pabloko escribió:
10 Jul 2021 17:08
looking at your firmware, youre expecting non-ascii data, so try to create the payload like this
string.char(0x01)
string.char(0x00)
string.char(0x01, 0x02)

ySerial(string.char(0x01))
This generates a string literal containing the bytes, and can contain arbitrary zeros in it.

Maybe this is why some leftover bytes could be causing software disconnect.

Apart from that, ill try to replicate when i have some time
Hi pabloko.. thanks for this, but i tried the
ySerial(string.char(0x01))

its not working in my side maybe need more edit in a fw side?

Thanks
Hi pabloko.. do you have any sample using usbhid.dll? i order device USBHID but cannot make it works..
Thanks
Hi Pabloko.. since i really have problem using esp8266 with serial.dll.. now i want to try the HID.dll
i have a usb hid device, would you mind sharing an example using hid? i was able to get the list of hid already but confuse this two things

device = HID.Open(vid,pid,serial) --serial can be 0, check device not nil
device = HID.OpenPath(path) --check device not nil

can you help me.. thank you
hi pabloko, hope you can response to me..

i always get a nil value line device = HID.Open(vid,pid,serial) --serial can be 0, check device not nil

table = HID.Enumerate(0) --use 0 for wildcard
_hid = Table.Count(table);
for i=1, _hid do
result = ComboBox.AddItem("ComboBox1", table.manufacturer_string.." "..table.product_string.." - "..table.vid.. " "..table.pid, i);
end

dev = ComboBox.GetSelected(this);
index = String.ToNumber(ComboBox.GetItemData(this, dev));

vid = table[index].vid
pid = table[index].pid
path = table[index].path
serial = table[index].serial
release_number = table[index].release_number
manufacturer_string = table[index].manufacturer_string
product_string = table[index].product_string
interface_number = table[index].interface_number

device = HID.Open(vid, pid, 0)
result = Dialog.Message("Notice", tostring(device), MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);

the result is always nil..


device = HID.Open(vid, pid, 0)
device = HID.OpenPath(path)

written=HID.Write(device, "0x03") --data is a literal string


Thanks for your help pabloko...

Regards

Sendai
:sorry: :sorry:
:dancing: :dancing: :dancing: :dancing: :dancing: :dancing: :dancing: :dancing: