Arduino GSMShield - c++

I've been working on a project with arduino UNO and GSM Shield.
I'm uploading to Internet data every 30 minutes from a maxbotix sensor. Code hangs and loops continuously with the serial monitor showing gsm.begin() waiting for reply.
I have read very carefully all the related forums and rewrote the library file GSM3ShieldV1AccessProvider.cpp as per http://forum.arduino.cc/index.php?topic=233137.0
Unfortunatelly this doesn't solve the problem. With gsm debug set to true it stucks on the the infamous AT%13% (post http://forum.arduino.cc/index.php?topic=233137.0)
This is driving me mad as it ruins the whole project.
Anyone has find a workaround?

If Arduino stucks at this point that's because the modem is answering with ERROR to the AT command and it doesnt continue to AT+CPIN, AT+CGREG ...
So, obviously it's not a SIMcard problem neither a APN problem
Have you try to update the GSM library?
Please, show me the debug log you are getting
GSM gsmAccess(1);

Related

when plugging pi pico via usb i dont see com port and thus cant run hello world

so I am trying to use serial so I can view what I output in a serial monitor. But when I plug my pico in and upload my uf2 file that is a while loop that prints hello world and then waits 1 second.
I have tried using the flash nuke .uf2 file but that didnt work and I think I have my cmake file correct as I have the 2 lines `
pico_enable_stdio_usb(Encoder_Test_No_Interrupt 1)
pico_enable_stdio_uart(Encoder_Test_No_Interrupt 0)
`to disable uart and unable usb. I am not sure if there is something I am missing but I find this really confusing. Any help with this would be great.
Thanks in advance,
Dean
edit: If I run hello world and upload via the arduino IDE it works, so I dont think there is anything wrong with my hardware, but rather something I must be doing wrong in the suftware

Ethercat communication defect after building c++ program

For my work, I am currently working on a existing system (C++) that communicates with a beckhoff PLC. This PLC reads the current speed of the process and controls a light.
This program needs an update to work with the new thickness measurement. The code for this new measurements works, we tested it on another computer.
The problem is that the communication between the beckhoff and the computer is not working anymore. This problem starts when we rebuild (a part of) the program. To check what went wrong, we used wireshark to check the communication.
In the figure below, you can see the correct communication with the Beckhoff PLC (with Ethercat).
In this figure, you can see the communication after we build the new program.
Of course, we tested a lot of option to elimate this problem but at the moment we cannot think of any other method to get the communication back.
Things we tried:
Compile the old code to see if the communication still works. This doesn't work. Only the originale .exe file works.
Go a few version back to test the communication. This also doesn't work.
We check the hardware configuration and the mac adress of the Beckhoff PLC. This is all correct.
It would be great if someone knows a solution for this problem. Please, don't hesitate to ask question for more information about the problem.

Max For Live Not Patch Not Updating Data on Arduino Display

I've been working on a project with an Arduino recently where I'm basically trying to get a small display hooked up to an Arduino to update with the name of a MIDI mapped knob in Ableton Live.
For example, let's say I map the knob to the reverb send on a track the display should read "A-Reverb". This works today, but only works when I first open the Ableton project and map the knob for the first time. It does not update when I select a new option.
Here's the setup I'm using right now:
Arduino - w/Rotary Encoder & OLED Display
Hairless MIDI - For converting the serial connection from the Arduino into MIDI CC# messages Live can read.
Ableton Live 11 w/ Max For Live 8 - This is where the patch actually runs.
For the Max Patch, I'm using a version of Yehezkel Raz's One which I purchased and later modified. The reason I mention this is that this patch already has the name updating part worked out, so in theory I should be able to send that data over serial to the Arduino.
Out of respect for Yehezkel's work, I won't attach a screenshot of the entire patch, but have attached the part that I modified to send data to the Arduino, you can see it here.
Here's what I've tried so far:
Validated that the baud rate for Hairless MIDI, the Arduino, and the Max Patch is identical
Attempted to start Hairless MIDI only after Ableton has been launched
Attempted to power on Arduino without opening the Arduino IDE so that there are no Serial conflicts.
Here's what I think may be the issue, but I'm not sure how to fix it:
Part of the logic in my Arduino code relies on Serial.available() being true, in order to send the data to the screen. I'm thinking that maybe the Serial connection is only available in the beginning when the knob is mapped.
I know that was a lot of information, but if anyone has any ideas on how I may be able to get this to work, I'd greatly appreciate it!
Okay I figured this out on my own; basically what was happening was my code was expecting a line feed in order to refresh the output on the display. I figured out that I could send a line feed over the serial connection by sending the value "10" which would basically terminate the string as it is sent to the Arduino.
Any time the knob value is updated, it triggers a button which sends the value "10" back to the Arduino.
I've attached a screenshot showing the changes I made in case this helps anyone else out:

UDP video using QMediaplayer library

I've been playing around the QMediaplayer library. I was curious about how it would work with some streaming video source, so I've used VLC to stream some videos using udp protocol.
To make a quick test, I've used the Qt example named MediaPlayer example. As the example is designed to work only with offline files, I've added on dumb function on the Player implementation.
void setM(QUrl url){player->setMedia(url);player->play();}
Then, on the main.cpp file I call this function like this:
...
player.setM(QUrl("udp://239.1.1.1:1234"));
return app.exec();
What this do is start to reproducing the stream source once the program is read.
The problem here is that Qt through me the following error:
DirectShowPlayerService::doSetUrlSource: Unresolved error code 800c000d
To do this with local files and http streaming and it works... but when I tried with UDP or RTP I always get the same error.
I've spent few hours looking for more information, but always get the same response... use QMLVLC... For example, look this.
Does anyone tried this before? What's is wrong here?
PD: I know that there is a VLC plugging to make this work, but I would like make this work only with Qt (or at least, understand what is happening here).
PD2: I'm on windows 8.1, Qt 5.5 (mingw 4.9.2) and I have all the important codecs installed.
Thanks in advance,
UPDATE
Finally, I manage to deal with the new http://code.qt.io and here is the code I suspect is blocking udp (and others) protocols-> here.
Maybe, only "http" and "https" are accepted as valid stream sources on Directshowsservice... I'll try to get some extra time this week to recompile just the multimedia module for windows in order to add udp procotol to the function doSetUrlSource and see what happens. If anyone test it first, please let me know here!
UPDATE 2
First of all, I suspect QMediaPlayer couldn't reproduce UDP/RTP content because the AddFilter method... Anyway, http,https and rtsp works perfectly.
Secondly, I've found some strange behavior over udp protocol.
I'm using "udp://#239.1.1.1:1234" as test multicast direction. The strange thing is that during one test I put this direction by mistake "udp://#239.1.1.1:1234z" and this time no error has been through. It seems that the direction needs to contain a letter.

Issue with hex data being sent out of a serial port

I am really hoping someone can help me with this issue, I have been working on it for 3 days and its driving me insane now.
I have two linux based devices connected over serial, one is an embedded device the other is a pc type device. I have some python code on the PC device that currently, successfully reads messages sent by the embedded device (hence the serial settings are correct).
However I now need to send commands back to the embedded device and this is what i am struggling with, I have a data tap on the serial line so i can see the data being sent / received.
When I send the string "\x2a\x00\x00\x00\x00\x00\x57\x78\xD6\x81\x00\x01\x00\x8D\x54" out of the serial port, on the serial data tap I see only "EF F7 FF FF".
Please see the code below:
import serial
serialport = serial.Serial(port=self.device,
baudrate=self.baudrate,
bytesize=self.bytesize,
parity=self.parity,
stopbits=self.stopbits,
timeout=0)
data = "\x2a\x00\x00\x00\x00\x00\x57\x78\xD6\x81\x00\x01\x00\x8D\x54"
serialport.write(data)
serialport.flushOutput()
This is now resolved, turned out to be a couple of issues the customer neglected to tell me that unless the embedded device is in engineering mode it will ignore commands. Also the data tap had a dip switch set incorrectly, so there was nothing wrong with my code. Thanks to Shane for making me question the hardware and not my code !