SIM5320 Arduino GPRS shield with MQTT - arduino-uno

The new arduino GPRS/GSM 3g shield says that it has MQTT support with AT commands. However, each command that I've tried from the official documentation has returned an error and every other person on the internet has reported the same thing.
I have been using the adafruit fona library to run it and everything that it offers works on my board. As it's very new though, it doesn't have any MQTT implementation.
I know that the SIM900 chip has libraries for MQTT, but they don't work with the SIM5320. Does anyone have any advice on where to start for getting this chip to run MQTT?
Thanks in advance

At the end it is done via TCP. So if you establish a TCP connection and send the MQTT "connect" and "publish" messages, you should be able to connect and publish.
Here you can find a library that worked for me: https://github.com/andyduino/MQTT-for-SIM900/tree/master/libraries/mqtt
Instead of using "AT+CIPSTART" on SIM900 you will need to use "AT+CIPOPEN" on SIM5320, I think.

There's a really nice arduino library that you can adapt to use with your module. Its specifically for SIM800. Your module may take slightly different AT commands, so all you would have to do is change the commands. Here's a link to the library ->
https://elementztechblog.wordpress.com/2016/07/18/arduino-mqtt-library-for-sim800-gsm-modem/
Be warned, it will take some time and effort to adapt this to your module. But I'm pretty sure its as simple as swapping out some AT commands. I hope this helps you.

Related

How to make a Google Home (Mini) publish what it listens to a MQTT topic (and broker)?

I have a Google Home Mini and I'm trying to use it as a speech-to-text device. The way I intend to do so is by having the device listening to what is said and publishing that input to an MQTT broker in order to my application to listen to it.
I have found this, that returns the input as text, but all it gives me is the certainty I can get this data. I have little to no clue on how to make it publish this data as an MQTT message.
Also found this, but can't make it work, because it states "There’s a very easy way to recognize custom phrases in Google Assistant,[...] I won’t cover it here". And even the Google's instructions (open "Create an Applet") seems to be out-dated in relation to IFTTT, because the steps simply aren't followable in IFTTT's interface.
Here is a quick sketch of the architecture:
There're 5 arrows. The first one is, obviously, a physical process. Arrows "Audio" and "Text" are automatically done by the hardware. The right "MQTT Message" is working already. So what I wanted help with is the "MQTT Message" arrow from "Google Home" to "MQTT Broker".
Thanks in advance.
The short answer to this is you don't (as you've described it).
The slightly longer answer is that you first have to move the arrow you are interested into to the cloud and it's not a MQTT message.
The Action box needs to be hosted on a publicly accessable machine (e.g. AWS/GCP/Azure/IBM Cloud) so that the Google platform knows where to find it.
Google have 2 different types of actions, one for conversational type interactions and one for controlling smart homes devices. You've not mentioned what you are trying to do so I can't say which one you really want.
Google have recently announced the Local SDK for interacting with smart home devices that is slightly closer to the diagram you have included. This can only be used for device control and still can't send MQTT messages, it supports HTTP, raw UDP or TCP (you might be able to implement a MQTT client using the raw TCP, but it would be a lot of work and I'm not convinced the keep alive would work)
I think I got what you need:
Configure the Google assistant to parse your speech, then connect it to ifttt (as I already did it in the past, it's very easy) to send HTTP requests.
NOW create a local web server that understands these requests from ifttt, and publish them to your broker.
And that's all!

Add protocol to gammu

By default gammu have support for most standard modem. I have a very particular modem with some special requirements and I would like to add a protocol to gammu.
Is there a guide for this somewhere or someone who can list the basic steps for me?
EDIT: #user1664784 recommended to look att Kannel, and actually any system able to handle incoming and outgoing SMS is acceptable as long as it is stable. But I need to know how to modify the system so that I can handle a specific protocol. It is AT-based but a slight dialect. So any suggestion of a system handling SMS from a device connected over serial port is interesting. I need to find a system where someone can give me information on where in the source code I can begin adding a new AT-based protocol.
If someone have done some sample code in this area it would also be greatly appreciated.
It really depends how much different it is from standard AT commands.
If the difference is minor (eg. needs custom initialization), it can be easily achieved by feature flags. This can be seein ATGEN_PostConnect which handles initialization for ZTE or Huawei devices.
If the differences are big, you will probably need to write own driver, which will fall back to AT in some cases. Something similar can be seen in the AT OBEX driver which switches Bluetooth connection between OBEX and IrMC modes.
I think we used to have documentation on adding support for new devices, but I'm unable to find it right now.

Events for Ldap in Bro IDS

I have to implement a dsniff version for bro as my final year project. So I started by writing bro scripts where I use protocol events that were implemented by Bro. The thing is Bro didn't implement events for all the protocols and LDAP is one of protocol that suffer from absence of events in BRO. So I was wondering what is the best way to achieve this. I mean : Do I need to add dissectors and events for theses protocols, or do I need to use some functionality of that I missed? (I'm newbie in Bro)
Thank you very much for your help.
For others that want to do the same as me, there's no analyser implemented for ldap. But this not a big problem because there's a handfull tool that helps us to write, simply and easily, analysers of protocols that uses Tcp or UDP as transport layed. This tools is called Binpac. Here's a link of a quickstart up: https://www.youtube.com/watch?v=1eDIl9y6ZnM.
And for people who wanted to know what we have managed to do for the project Bro-Dsniff, here's the link of git : https://github.com/rsabir/bro-dsniff

Telnet lib and language choice for cross OS telnet client?

I'm looking to start a MUD client application, which connects to a MUD hosted on a telnet server. The only thing important to me is that it runs painlessly and efficiently across any OS. Aside from that requirement, I'm not really sold on any language.
So I'm looking for a freely available telnet client library on which I can base my application, so I don't have to deal with the details of the protocol too much.
I would always consider Twisted for this kind of thing (Python).
The beauty is that if you later decide to swap it out to SSH or anything more secure than telnet, you can with little pain.
Twisted, twisted, twisted!
To use telnet, see package twisted.conch.telnet. It's got some spartan API docs, but the real information on using it comes from searching on Google Code Search, such as this nugget from grailmud - a MUD server.
For all of my MUD programming, I just created my own routines from the ground up using the RFCs.
In case you'd like to avoid some of my pain, I wrapped it up into a fairly simple C# class that handles Telnet properly. In case you'd like to peruse it, you can view it here.
This code has been copy/pasted and run on Windows and on Linux (through Mono) on a handful of separate projects and works pretty good.
There is a telnet interface in CPAN if you like Perl. It's pretty minimal, but it should get the job done.
[edit]
libcurl is also supposed to be able to do telnet, although I couldn't find any examples of it.
pmc ( http://sourceforge.net/projects/perlmudclient/ ) was an attempt to do exactly this. I've spent some of the last week going through it; it uses an older modified version of Net::Telnet to do its connectivity work.
My problem is that Net::Telnet seems to have a blocking interface when a partial line is sent by the server, i.e. a line not terminated by a newline. It has two features that support this (waitfor and its prompt mechanism), because almost all telnet servers have prompts that are not newline-terminated.
MUDs often have "prompts" that are non-standard and vary through the course of the game; the MUD I admin on has a "Your choice: " prompt as its login [it's not just for usernames], and many game features present alternative prompts. So I suspect you'll need to bear this in mind when you go looking for a cross-platform Telnet library!
If you like C, I heartily recommend libtelnet. It will maintain an internal state that does all the IAC sequence parsing for you, and handles option negotiation using the Q method.

What is the best way to handle incoming SMS messages?

I have a client who wants a solution to allow delivery people to text (SMS messaging) in that they have completed a pick up at a particular location. What I'm looking for is Code to read an imbound SMS message or a SMS component if appropiate. This would allow me to create a windows service to read the message and update a SQL record accordingly.
Probably not quite what you're looking for but one approach is to use a gateway like iTagg which provides a number of interfaces for developers to send and receive SMS/MMS etc. Depending on your location, iTagg may be no use but I'm sure there'll be an equivalent for your region.
Sometime ago I implemented something similar using a GSM modem. I think most of the GSM modems offer AT commands that can be used for receiving and sending SMS messages. At the time, I used a library in Java that provided a easy to use API. The commands to read and send SMS are really easy but I bet there is something in .Net for that purpose that can make the task even easier.
I made a little search and I found this article with an example of using AT commands to interact with a GSM phone. I looked into the supplied source and it includes a library with operations related to SMS.
In my previous project I used a Siemens GSM modem with a RS232 interface. It wasn't very expensive and was able to manage all the messages sent by onboard units placed in vehicles. But if you have a unused phone it can work as well.
Thanks Luke, I am thinking more of a GSM modem which would be connected to the server. I think this would give more control rather than go through a third party, but I take your point and will investigate further.

Resources