Qt+Mac: serial port doesn't answer on commands - macos

I use modified QExtSerialPort because I don't need any libs. I write to port successfully and successfully read from port if data generated by device itself. But on my commands to it it doesn't answer. bytesAvailable () always returns 0 on any attempt to read after successful command record.
Under Windows all works fine.
I test com port with CoolTerm application and it work properly too.
How to fix this behavior?
Thx.

Related

How do I set up and test Gammu RunOnFailure script

Gammu documentation related to gammu-smsdrc config says
RunOnFailure New in version 1.28.93.
Executes a program on failure.
This can be used to proactively react on some failures or to
interactively detect failure of sending message.
The program will receive optional parameter, which can currently be
either INIT (meaning failure during phone initialization)
I have added the following to my /etc/gammu-smsdrc config file:
RunOnFailure = /home/pi/fail.sh
How do I access and use the parameter INIT? I want to setup SMS notificaion on failure of phone initialization.
I figured it out.
There are two scenarios of failure.
Problem with sending a message. In which case $1 (bash) will be an integer which is the row id of message in MySql database. I am not sure what its going to be if you have configured Gammu in file backend mode.
Gammu cant access or connect to the phone or GSM modem. In this case $1 = INIT.
I am using a PHP script to RunOnFailure so it is going to be $argv[1] for me.

Windivert fails in Win10 - Solution to TCP 3handshake - Evade windows RST packets

I had a project which used windivert to work as a router in my network, and it worked fine but now is dead with the same code. Previous versions which worked succesfully now dont work. I always get the same Windivert error which is 997 (Overlapped I/O operation is in progress).
For example when I use WindivertOpen I get the error, when I restart the computer to reset the windivert driver I dont get the error 997 in WindivertOpen but I get it in WindivertSend or WinDivertSendEx and after use them I again get the error in WindivertOpen. These functions worked fine for me months ago and my router worked as I expected, but now I am done with these errors, there is nothing I can do, maybe this is caused by a windows security update.
I need to know how to reset the driver without restart the computer and to know what I can do to face this problem. I used windivert to block windows TCP RST packets to my router fordwards, windows does this when there is not sockets associated with the ports that you are fordwarding, what can I do to block this packets without windivert or with a working way of windivert?
The 997 error is ERROR_IO_PENDING, but the error code is meaningless unless WinDivertOpen returns INVALID_HANDLE_VALUE. Otherwise the call will have completed successfully.
Presumably you have upgraded to WinDivert 1.4 from a previous version. Simply replacing the binary files (dll/sys) won't work -- you must instead recompile your program against the new API.

Netcat FTP active mode file transfer not working

Im trying to download a file from a FTP server using active mode.However,it looks like my connection just"expire" or something each time.First,I open a port on my computer using netcat,ex:
nc -vv -l -p 62077
this will listen on port 62077 on my computer.Then,I open another netcat windows,log in to the FTP link using port 21,and once im in the directory where the file I want is in,I do
PORT (my IP separated by , ),(242,125(wich equals to port 62077)\r\n
However,after I enter this command,nothing happen for about 10-15 seconds,and the netcat just quit without saying anything.Nothing happen either on the netcat window that is listening on port 62077.It does that everytime,I dont know what I am doing wrong.I did the same thing with Filezilla(in active mode) and examinated the commands with wireshark,I do the exact same command as Filezilla,however filezilla will be able to retrieve the file while netcat wont.I want to retrieve it with netcat and I dont know what im doing wrong.I am using Windows 10.
thank you!
After you have established your listening nc socket, and after you have sent the USER, PASS, and PORT commands, you then need to trigger the file transfer to that listening socket using e.g.:
RETR /path/to/file/to/download
on the control connection. (Unless you actually are already doing this, but didn't mention it in the post?)
Also, just to note: you mention using something like this:
PORT 1,2,3,4,(242,125)\r\n
Right? Those parentheses might also be an issue. Instead, you might try:
PORT 1,2,3,4,242,125\r\n
without any parentheses.
Now, depending on the IP address you sent (hopefully not a private network address), the data transfer may still not happen, due to firewalls/routers/NAT on the client side of things. Given that your Filezilla download of the same file works, I suspect that those firewall/router/NAT issues may not apply.
Hope this helps!

The command "cat" wont read my serial port

I have my arduino connected to my mac sending the temperature through /dev/tty.usbserial-A5025XZE serial port. Every second i want my script to save what is coming through the serial port but when i try
cat /dev/tty.usbserial-A5025XZE >log.txt
It won't write anything to the file and it seems like the command dosn't run, I have to use control - z to cancel it.
The command is blocked while it waits for data from the serial port. Your Arduino isn't sending anything.

libusb Windows using WinUSB BulkTransfer receiving inconsistant

I am attempting to communicate with a custom USB device through windows using libusbx. I have the WinUSB driver installed for the device and am able to get some communication to happen. It's just not operating as I expect.
I am trying to get some basic two way communication happening essentially from the PC I send a single byte and expect some number of bytes back. Currently if I reset the device and run my program that sends a byte, I only receive a single byte back. If I re-run my program, I get just the next byte back. This happens a few more times until eventually I receive what I expect.
For example:
PC sends an 'a'
the expected output is
buffer[0]=3c
buffer[1]=6c
buffer[2]=0
buffer[3]=3e
What I actually get is:
//First try
buffer[0]=3c
//Second Try
buffer[0]=6c
//Third Try
buffer[0]=0
buffer[1]=3e
//Fourth+ tries
buffer[0]=3c
buffer[1]=6c
buffer[2]=0
buffer[3]=3e
When I test the USB device over a com port using serial communication, everything operates as expected.
Here is a pastebin of the code being ran:
http://pastebin.com/bQtyS6vq
Has anyone experienced similar problems or have any suggestions for a fix?

Resources