The Dolly Dots again

In an adventure in follow up connecting the dots, I couldn’t resist and refer to an old Dutch Girls band, way back …

So I followed some handfeeding from GitHub - Azure/connectthedots: Connect tiny devices to Microsoft Azure services to build IoT solutions added JSON and AMQP lite as a reference, they are not mentioned in the dox. Maybe they are pretty obvious to somebody but not to me …

Furthemore, I changed the mainboard, network, sensors and see what it got me … a human sensitive raptor runnig the latest software and made using VS2013 U4 …

Oh, I had to do a new SSL Feed in MFDeploy (multiple times) the FEZ Config seems to bring no solution in this case …

The spikes in the picture is me walking by and see how the temp is reacting …

wish it did it to the real dots in the days back, now that would have been an adventure …

Edit: Now I don’t know why the picture is not uploading but you could look at http://dollydots.azurewebsites.net/ I hope that one works.

Edit 2: IT seems that you can’t use special chars in the file name, I’ll leave the live feed on for the coming 7 or 8 hours or so …

4 Likes

… so after some time, like minutes, sometimes more time goes by, I get a AMQP Timeout exception, the interlock stays and no new messages are written to Azure anymore, only a complete restart/redeploy of the solution in VS does get it starting again, so am I fludding some possible queue in Azure or how does this go, any body any idea ?

Or is this more off topic and should be reported to … ?

@ Pete Brown - Any body I could address ?

The error is outputted before the caught exception is outputted …

Frist this:

[quote]01/11/2015 15:03:34
Temperature=23.949999999999999
Humidity=32.759999999999998
Light=320.62561094819154
#### Exception Amqp.TimeoutException - 0x00000000 (1) ####
#### Message: The operation {0} did not complete within the allocated time {1} for object {2}.
#### Amqp.SenderLink::Send [IP: 002d] ####
#### ConnectTheDotsGadgeteer.Program::SendAMQPMessage [IP: 00b4] ####
#### ConnectTheDotsGadgeteer.Program::tempHumidity_MeasurementComplete [IP: 00d7] ####
#### Gadgeteer.Modules.GHIElectronics.TempHumidity::OnMeasurementComplete [IP: 0036] ####
#### System.Reflection.MethodBase::Invoke [IP: 0000] ####
#### Gadgeteer.Program::DoOperation [IP: 001a] ####
#### Microsoft.SPOT.Dispatcher::PushFrameImpl [IP: 0054] ####
#### Microsoft.SPOT.Dispatcher::PushFrame [IP: 001a] ####
#### Microsoft.SPOT.Dispatcher::Run [IP: 0006] ####
#### Gadgeteer.Program::Run [IP: 001d] ####
A first chance exception of type ‘Amqp.TimeoutException’ occurred in Amqp.NetMF.dll[/quote]

Then this error:

[quote] #### Exception System.Net.Sockets.SocketException - CLR_E_FAIL (8) ####
#### Message:
#### Microsoft.SPOT.Net.Security.SslNative::SecureRead [IP: 0000] ####
#### Microsoft.SPOT.Net.Security.SslStream::Read [IP: 0040] ####
#### Amqp.TcpTransport+SslSocket::Amqp.ITransport.Receive [IP: 0007] ####
#### Amqp.TcpTransport::Receive [IP: 000a] ####
#### Amqp.SaslTransport::Receive [IP: 000a] ####
#### Amqp.Framing.Reader::ReadBuffer [IP: 0009] ####
#### Amqp.Framing.Reader::ReadFrameBuffer [IP: 0007] ####
#### Amqp.Connection+Pump::PumpThread [IP: 0039] ####
#### SocketException ErrorCode = -1
#### SocketException ErrorCode = -1
A first chance exception of type ‘System.Net.Sockets.SocketException’ occurred in Microsoft.SPOT.Net.Security.dll
#### SocketException ErrorCode = -1
#### SocketException ErrorCode = -1
The thread ‘’ (0x8) has exited with code 0 (0x0).
Exception caught:The operation {0} did not complete within the allocated time {1} for object {2}.
[/quote]

It all happens in this:


        // Send a message to Azure Event Hubs using AMQP protocol
        // we are using the sender resource created in the intialization
        void SendAMQPMessage(string payload)
        {
            try
            {
                // 0 indicates the method is not in use
                if (0 == Interlocked.Exchange(ref IsSendingMessage, 1))
                {
                    // Create the AMQP message
                    var message = new Message();
                    message.Properties = new Properties()
                    {
                        Subject = "wthr",
                        CreationTime = DateTime.UtcNow,
                        ContentType = "text/json",
                    };

                    message.MessageAnnotations = new MessageAnnotations();
                    message.MessageAnnotations[new Symbol("x-opt-partition-key")] = DeviceID;
                    message.ApplicationProperties = new ApplicationProperties();
                    message.ApplicationProperties["time"] = message.Properties.CreationTime;
                    message.ApplicationProperties["from"] = DeviceID;
                    message.ApplicationProperties["dspl"] = DeviceName;
                    //message.Properties.ContentType = "text/json";
                    message.Body = new Data() { Binary = Encoding.UTF8.GetBytes(payload) };

                    sender.Send(message);

                    // release lock
                    Interlocked.Exchange(ref IsSendingMessage, 0);
                }
            }
            catch (Exception e)
            {
                Debug.Print("Exception caught:" + e.Message);
                InitAMQPconnection();
            }
        }

TWIMC - Just switched from RS21 to ENC28 to rule out any wifi unstability …

have a look at http://dollydots.azurewebsites.net/ to see how raptor spits out temp humid near real time …

Nice work!
Just checked out the site (dollydots), cool!

Saw the conversation on twitter about SignalR being used, but I can only see regualr websockets in the code?

@ uffe - It is just a re-use of the connectingthedots at git, I followed the instructions and adopted the software to my gadgeteer environment. Changed a bit here and there, and it all of sudden it started spitting data … and the gadgeteer code is amongst the simplest … the RS21 compared to the ENC28 seems to have more doubt about this continious traffic feed …

As you can see, the data still comes in and keeps on going. I’ll have to see how stable this is with the wired connection …

After some time I probably will add more devices just to see how it scales … like spider, another raptor and finally an old cobra, there is room for 4 devices. And maybe get a grips on how to add a lightsense as well …

@ PiWi - Thanks for the clarification. It was not you that mentioned SignalR on twitter so I guess that the other guy just made an assumption.

Cool stuff! Inspired and will try to create something my self

Cheers!

Well done!

I’ll need to check out the source of that project, to see how Microsoft actually implement the whole things.

Meanwhile, I did something similar using Firebase. It let you easily sync data back and forth in real-time using a document store (Had to prove to a friend that using NetMF, you are not necessarily tied into Azure!). Still a few bug to fix… but…

http://www.threadhung.com/LiveTemp

Well done again! Keep it rolliin’

Later.

Now I’ve got a timeout error as well on the wired connection but that connection lasted much longer.

Starting @ 16:10 end ending at 20:17 … not bad for a start, 4 hours …

First by the AMQP.NETMF.DLL:

[quote] #### Exception Amqp.TimeoutException - 0x00000000 (1) ####
#### Message: The operation {0} did not complete within the allocated time {1} for object {2}.
#### Amqp.SenderLink::Send [IP: 002d] ####
#### ConnectTheDotsGadgeteer.Program::SendAMQPMessage [IP: 00b4] ####
#### ConnectTheDotsGadgeteer.Program::tempHumidity_MeasurementComplete [IP: 00d7] ####
#### Gadgeteer.Modules.GHIElectronics.TempHumidity::OnMeasurementComplete [IP: 0036] ####
#### System.Reflection.MethodBase::Invoke [IP: 0000] ####
#### Gadgeteer.Program::DoOperation [IP: 001a] ####
#### Microsoft.SPOT.Dispatcher::PushFrameImpl [IP: 0054] ####
#### Microsoft.SPOT.Dispatcher::PushFrame [IP: 001a] ####
#### Microsoft.SPOT.Dispatcher::Run [IP: 0006] ####
#### Gadgeteer.Program::Run [IP: 001d] ####
A first chance exception of type ‘Amqp.TimeoutException’ occurred in Amqp.NetMF.dll
[/quote]

The caught exception by the sofware:

[quote] #### Exception System.Net.Sockets.SocketException - CLR_E_FAIL (7) ####
#### Message:
#### Microsoft.SPOT.Net.Security.SslNative::SecureRead [IP: 0000] ####
#### Microsoft.SPOT.Net.Security.SslStream::Read [IP: 0040] ####
#### Amqp.TcpTransport+SslSocket::Amqp.ITransport.Receive [IP: 0007] ####
#### Amqp.TcpTransport::Receive [IP: 000a] ####
#### Amqp.SaslTransport::Receive [IP: 000a] ####
#### Amqp.Framing.Reader::ReadBuffer [IP: 0009] ####
#### Amqp.Framing.Reader::ReadFrameBuffer [IP: 0007] ####
#### Amqp.Connection+Pump::PumpThread [IP: 0039] ####
#### SocketException ErrorCode = -1
#### SocketException ErrorCode = -1
A first chance exception of type ‘System.Net.Sockets.SocketException’ occurred in Microsoft.SPOT.Net.Security.dll
#### SocketException ErrorCode = -1
#### SocketException ErrorCode = -1
The thread ‘’ (0x7) has exited with code 0 (0x0).
Exception caught:The operation {0} did not complete within the allocated time {1} for object {2}.[/quote]

Any ideas ??

I got one going here:

http://myconnectthedots.azurewebsites.net/

So I’ll run a Raptor on wifi and a wired Spider and see if I run into any problems over time.

If anyone else builds one of these, start with the Cloud Deploy project and not the Web Site like I did as I think it messed up the Cloud Deploy and caused an error when I ran it.

1 Like

@ Duke Nukem - Cool. Mine ran whole night but kind of got lonely when a left it alone driven to work …

now sensors are not selectable anymore and the websites renders into an undefined error …

it is somewhat unstable … TBC

whow …

since when looking @ Duke’s website I got the same undefined error I had the idea it could be something local here I amn at the moment and tried it on my cell … surprise, surprise, mine did still work and checking Duke’s … working as well …