I'm trying to debug my PC using laptop and serial port.
So, I wanna get some printk log from tty connected laptop.
I referred this sites (https://help.ubuntu.com/community/SerialConsoleHowto), and I already set all of console setup on my laptop and I also saw the login session from laptop.
However, despite all my effort, I couldn't get the printk log message at the tty console (I also set /proc/sys/kernel/printk as 7417 to get all the message of printk).
The curious thing is, my local console (ctrl + alt + f1~f6) are printing the printk log at the same time.
So, how can I get printk message from tty connected host device?
thnks,
This command
dmesg -wH &
could be used to force all your kernel messages, that are printed to dmesg (and also the virtual terminals like Ctrl+Alt+F1 , depending on your /proc/sys/kernel/printk log level and a level of your message), to also appear at your SSH or GUI console: Konsole, Terminal or whatever you are using! Should also work for ttyS0 console, I hope. And, if you need to monitor only for the specific messages:
dmesg -wH | grep ERR &
I'm using it to monitor for the "ERROR" messages like
printk(KERN_EMERG "ERROR!\n");
that I printk from my driver
Related
I am trying to set the memory location of my phone (Nokia 2730 Classic) but I am not able to set the storage location. I have also tried with the 7 port multi sim card hub and got same issue there as well. I am using the Ubuntu system and using Minicom and Screen command to connect serial port. When I tried to send SMS from the device using AT command it is working fine but the reading of SMS is not working due to storage location is not set.
While I am trying to execute command AT+CPMS I got below results.
AT+CPMS?
+CPMS: ,,,,,,,,
OK
AT+CPMS=?
+CPMS: (),(),()
OK
And when I try to set the location of storage using below commands then getting errors.
AT+CPMS="SM","SM","SM"
ERROR
AT+CPMS="ME","ME","ME"
ERROR
AT+CPMS="MT","MT","MT"
ERROR
AT+CPMS="SM","ME","MT"
ERROR
Please let me know if you have any solution.
Thanks
Currently I dial in to a site with putty and copy all 100 commands using notepad++ and paste them into putty using right click and they all give me the expected results.
I don't want to have to copy and paste each time I connect.
I am trying to use putty to load a saved session and then execute a series of commands.
can this be done with a serial connection ??
this is as far as I can get
my batch file looks like this
plink -load session1 < commands.cmd > output.txt
for testing my commands.cmd looks like this
ATDT5551212
functionally this is fine for dialing and executing a single line as my output.txt file looks like this
ATDT5551212
CONNECT 1200
so I know I can grab a command from a file and send the output of the session to another file...
if I add another command after the ATDT line then it fails to work properly however my output file shows it sent all the commands
The problem is after dialing and connecting I want to be able to send another set of about 100 commands to get programming data out of a serial device and record it to text.
How can I set this up as a batch to wait for the CONNECT 1200 and then execute another 100 different commands
I tried as Martin suggested to change the EOL
I added STXcommandETX and also separately tried an EOT and ESC and nothing changes its just dumping the entire command file and only executing the first line. the modem gets bombarded with all the other lines or commands, it is attempting to execute the first line and then subsequently trying to give a response meanwhile plink just took the entire commands.cmd and dumps it at the modem and the modem is not expecting the dump.
My guess is that plink can open and send my commands but cant interact with the Serial putty window once it is open.
I am trying another program called ScriptCommunicator but am still testing plink/putty
To connect from windows desktop to unix host, in order of administration on command line level, I like to use MobaXterm in it's free version
The connection is encrypted ssh, identification to Unix host is using user id, passwd.
There is an issue in I can't resolve:
In the "Session Settings" is a field "Execute Command".
This command there is supposed to be executed in the target host when login has been successful finished. The hosts I have to use are may be not the fastest - Or MobaXterm is too fast.
However, the command is issued in a to early stage, the host feels mortally offended, closes connection and throws me out.
It does not matter what the command is - even a sleep is not accepted.
How to tell MobaXterm to act a bit slower?
MobaXterm default behavior for executing a command is to close the session after execution.
To prevent that there is a setting near the "Execute command" field that states: "Do not exit after command ends". Just check that and it will fix the problem.
I currently have a Java Applet running on my web page that communicates to a display pole via COM1. However since the Java update I can no longer run self-signed Java Applets and I figure it would just be easier to send an AJAX request back to the server and have the server send a response to a TCP port on the computer...the computer would need a TCP > COM virtual adapter. How do I install a virtual adapter to go from a TCP port to COM1?
I've looked into com0com and that is just confusing as hell to me, and I don't see how to connect any ports to COM1. I've tried tcp2com but it doesn't seem to install the service in Windows 7 x64. I've tried com2tcp and the interface seems like it WOULD work (I haven't tested), but I don't want an app running on the desktop...it needs to be a service that runs in the background.
So to summarize how it would work:
Web page on comp1 sends AJAX request to server
Server sends text response to comp1 on port 999
comp1 has virtual COM port listening on port 999, sends data to COM1
pole displays data
EDIT: I'm using Win 7 x64 and tcp2com doesn't work as a service. I tried using srvany but I get an error stating that the application started then stopped. If I use powershell and pass the tcp2com as an argument, it doesn't quit but it also doesn't run. So I nixed the whole 'service' deal and put the command: powershell -windowstyle hidden "tcp2com --test tcp/999 com1" and it works...sort of. The characters that get sent are all effed. I can write "echo WTF > COM1" on another computer which has COM2TCP (different vendor) and it'll come up as a single block on the POS display pole. However if I use COM2TCP on both the server and client machines, everything works fine...but that's only a trial version and it costs several hundred dollars! On another note, is there a way to send the raw text over IP without having to use another Virtual COM > IP adapter on another computer? Sort of like how curl works but different...?
After somewhat of an exhaustive search, I came across a program called 'piracom'. It's a very simple app that lets you specify port settings for the express purpose of connecting a serial port to an listening port over the network. So this is IP > Serial. For Serial > IP I used HW-VSP3-Single as even on the piracom website it said it's compatible! I've tested and it works!
I just put a shortcut to piracom in the startup folder of my user account; the app runs off of a .ini that it updates every time you make a change...so if you run the server and hide it, on the next reboot of the pc it'll start up running and hidden with all prior settings. Easy.
Now it's a matter of installing HW-VSP3 on the server and making a method on the Rails app which will write to the virtual COM port. The only issue I can see right now is that writing echo \14Test This! > COM3 actually prints the \14...if I do that in my Java applet, it sends the "go to beginning" signal.
Addendum 1: The \14 problem was fixed by using the serialport gem for RoR. I created a method in a controller that returned head :no_content and then send data to the COM port. Calls to this method were made via jQuery's $.Ajax, using "HEAD" HTTP method. Apparently though I had to add the GET verb in Rails routes because the HEAD option isn't supported for some gimpy reason.
Addendum 2: Some garbage data was being sent to the display pole at the end of the string...turns out I needed to turn off the "NVT" option in HW-VSP3. Also keep in mind that firewalls need to be modified to allow communication.
I have a serial device with which I am trying to communicate. This device knows when a complete command has been sent when the command string is terminated with a "\r". Thus, a typical command string might be something like "COMMAND \r".
I'm having trouble configuring stty in such a way that the carriage return gets sent to the device. Currently, the device will not respond to any of my commands, so it's as if the input to the device is still "hanging."
I've written some simple C code where I bypass the terminal and there I can successfully elicit replies from the device, which is the reason why I think that the commands are not being properly terminated in the terminal. I've tried many different permutations of -+onlcr, +icanon, etc to no avail. The baudrate, parity, data bits, start and stop bits are all properly configured, as far as I can tell.
How can I debug this issue?
What is the platform (machine)? What is the OS?
Have you tried to flush the output with
fflush( FILE * FP );
Tried COMMAND\r\n ? What's the device?