What's the best way to spy on IOCTLs? - modem

I have a U9 Telit modem which, at first, appears as a disk drive on USB bus. Then, the native software after autorun and install, sends a couple of IOCTLs to tell the device to reappear as other things. I can see them in procmon.
I want to better spy on these, to know exactly what they send and how, in order to do the same in proper way.

Try something like Systemtap. Attach a probe that dumps all ioctls and arguments from the kernel, grep through them.

You could use something like strace under linux. The windows equivalent is discussed here Systrace for Windows.
This might show you the ioctl commands sent.
Some companies offer the linux kernels of their devices as direct download from their official webpage. There you might find more information on how it works. For some devices, it's easy to build and deploy your own kernel. This helps as you can add custom debug output.

Related

using webrtc for audio broadcast

I'm trying to stream a microphone/audio to multiple clients.
the broadcaster is a screenless raspberry, so I can't open a Webbrowser and click on "share mircophone"
The clients will be using their smartphone to listen.
the latency must be super low.
I did not find any WebRTC Demo that worked. All of them are either p2p or the scalable Broadcasting from muaz khan is only working for the initiator; not clients.
I came across Janus (which I didn't really understand what exactly this is doing) but I don't get how to install this and how to configure it.
Is there any way to easily share the microphone's output via WebRTC? Something like Apache hosting a simple website where the microphone audio is hosted on?
Thanks for all the ideas on how to solve it!
Is there any way to easily share the microphone's output via WebRTC?
No. There's nothing easy or simple about WebRTC.
the broadcaster is a screenless raspberry, so I can't open a Webbrowser and click on "share mircophone"
This is the simplest option... running a browser. Are you sure you need to actually allow it to access the audio device?
In the past, I've used a flag on Chromium to get around this problem. I don't remember exactly what that flag was, but looking at the list, it might have been...
--use-fake-ui-for-media-stream
You might also be able to use --enable-kiosk-mode.
At a minimum, if you were to open the browser interactively and enable access, that page would get automatic access in the future.
I did not find any WebRTC Demo that worked. All of them are either p2p
WebRTC is peer-to-peer, but remember that the "server" can be one of those "peers".
Finally, you can look into using GStreamer, but don't expect anything quick and easy. https://github.com/centricular/gstwebrtc-demos

Use Arduino programmer modes to upload code on virtual COM port

This question is related to Upload Arduino code on virtual serial port through Arduino IDE. The main problem is being able to upload code onto virtual COM port instead of using Arduino so I could take the binary code output and use it in some other application. The problem with that is that the process of uploading is also related to the bootloader on the Arduino and that's why the upload process never reaches 100%. The suggested solution was either to implement a bootloader in my application or use something that is already out there.
My question now is can I make use of the different programmer modes in the Arduino IDE to sort of by-pass the bootloader so the upload process can reach 100% and the code would actually reach the virtual COM port?
Any help would be highly appreciated. Thanks
Sounds like your Virtual Serial Port driver is getting stuck on some timeouts or buffers. The IDE calls avrdude with a specific protocol to match with what is built into the Arduino's bootloader, loaded on the AVR. There are other bootloader (in fact many, too many to mention), some of which may have different timing and such, but to use them would basically no longer be Arduino. to see the possibilities .\avrdude.exe -c.
If you are just trying to get a dump of what is going over the Serial port. I have used Virtual Serial Ports Emulator . It is very versatile in that its modular, allowing you to build up what you want.
Also, as mentioned from the other threads about this, note the data over the serial port is formated ontop of the STK500 protocol. You also mention in other thread that you don't want to use another tool to get the data. Whereas in order to use another protocol you would need to change the source compiler.java and rebuild the project as to call avrdude with the new protocol. So you might as well just get it with another tool. see below this will tie back in.
you can get the raw binary, from what is being fed to avrdude. Where as it may not be initially obvious. As avrdude get ELF not BIN. The Arduino IDE contains all of avr-gcc and its tools. Where avr-objcopy located in .\Arduino\hardware\tools\avr\bin can convert the IDE's output that is funneled into avrdude, to the binary you likely desire. No need for scoping the serial port stream.
To do this by hand, You need to locate IDE's temp working directory, by enabling the IDE's verbose compile prints. And also likely put avr-objcopy in your path. then simply call it as in the below example, substituting your sketch's filename, in place of mine.
C:\Users\mflaga\AppData\Local\Temp\build6135656488044319492.tmp>avr-objcopy -I ihex FilePlayer.cpp.hex -O binary FilePlayer.cpp.bin
Where as you could replace avrdude.exe with a batchfile that calls both avrdude and avr-objcopy to automat

Sending AT commands to my internal UMTS modem

I have a thinkpad laptop and I would like to send AT commands to my modem once it is connected to the network. The interface that is used is '/dev/ttyACM0'. What is the best way to send my commands there? I tried gnokii but wasn't able to connect to my modem :/ I also tried echo'ing commands to the device, this worked, but it is not easy to get the output of the command to proceed with the computation. Maybe one of you guys has a better way to do this. TIA
Have you tried minicom? (assuming from your interface that you are using Linux)
Introduction to minicom.
Entering "minicom" in www.alternativeto.net gives a link to another terminal emulator for Linux called Cutecom, but I have no personal experience of it.

SMSC911x network interface cards' light never comes back on after cable replugged

I have this strange problem in an embedded system (linux) we build, so I don't have normal GUI trouble-shooting tools on Linux or Windows machines.
The problem is the NIC is no longer usable after cable removed. Even if I re-plug the cable, the lights on it never come back on again and nothing can be sent or received. ifconfig still works on the surface, but doesn't have real effect. Only a reboot will solve the problem. I guess the problem is in the ethernet driver.
My question is how the trouble-shoot it. Any clues/hints? Thanks.
====================
Thank you guys! The board is a gumstix and the PHY is SMSC911x. We are running on Linux 3.0.12. It turns out the smsc911x_soft_reset() of the NIC fails when driver calls smsc911x_open(). The symptom also includes we must run ifconfig multiple times (not consistent) to bring the NIC up and the system can detect it.
I did a search on "SMSC911x soft reset failed" and find this link. http://comments.gmane.org/gmane.linux.network/216467. I removed SMSC_PHY=y in the linux build config file and that fixed the problem. It seems the driver is not compatible. Can somebody explain this, or is there a better solution?

GPRS and GPS on embedded Linux

I've got an embedded linux and a Telit gprs/gps module ("GM862-GPS" on USB-Port). My current project requires it to be connected via gprs for sending data, while continuously asking the module for the gps position. I'm connected to gprs with a ppp-daemon and chatsripts, but when the connection is established, the module seems to be locked (no reaction on AT-commands through minicom).
I read, that 'AT+CMUX' could be one solution, which is provided by this device, but I don't know how to use it, since the 'CMUX User Guide' by Telit isn't really helpfull (and a program for automatic setup is only provided for windows).
Does anyone know, how to deal with this command, or even knows a better choice to handle this problem ?
My answer might be too late.
You need to use CMUX to create another COM port to talk to it. I played with CMUX once and I understand your frustrations. In my case, it worked for a while and then failed and I couldn't find out why. You might want to post your question at Roundsolutions.
I programmed the module by writing Python scripts and upload to the module. Their Python API provides two channels to send AT commands to the module: MDM and MDM2. I use MDM as the AT command and use MDM2 to create sockets. Initially, you use MDM2 to send AT commands to create a socket connection. Once connected, whatever data sent to it will be interpreted as data stream instead of AT commands. They allow you to send '+++' to switch back to AT command mode.