Heater
Posts: 17120
Joined: Tue Jul 17, 2012 3:02 pm

resin.io

Thu May 28, 2015 9:55 pm

So I thought I would have a play with resin.io with my Raspi B+. http://resin.io/

First up of course is a hello app in node.js. Observations so far:

1) Everything worked as advertised. It's all very easy to get going.

2) It's great that resin offers public URLs for your devices. I was not expecting that. My Pi is now visible on:
http://bccbb0d6f38d1c3dec17eaeddc737106 ... device.io/

3) One could say it's a bit slow.

4) There is a great in-browser terminal connection to your Pi. For some odd reason it only works if your app is actually deployed and running.

5) Having modified my hello app to run forever the web terminal let me in. For fun I killed the app process. Of course the terminal connection immediately died!

So some questions:

i) How does one get a crashed or misbehaving application restarted from the web console. I could not find a way.

ii) How does one deploy the same app to different boards, say different versions of Pi or a Beagle or whatever?
Last edited by Heater on Thu Jul 09, 2015 4:26 pm, edited 1 time in total.
Memory in C++ is a leaky abstraction .

tonywaite
Posts: 30
Joined: Sat Sep 15, 2012 10:13 am

Re: resin.io

Fri May 29, 2015 10:09 am

Hi Heater,

This is intriguing, because it looks powerful but relatively easy!

Could you kindly post the node.js code so that we can have a play?

Heater
Posts: 17120
Joined: Tue Jul 17, 2012 3:02 pm

Re: resin.io

Fri May 29, 2015 12:27 pm

tonywaite,

Sure the code is attached. I have cleaned it up and added comments to make it fit for presentation. Not tested on resin but it works locally.

You will need to change the HTTP server port from 9999 to 80 to have it work on your Pi via resin.

This is of course only a hello world program, it is not the way I would want to write a sever in node generally.

Now here is the problem. Having tweaked the code a bit I can no longer push it to resin. When I do the normal "git push resin master" to get the changes into to my Pi resin refuses with the "Error: Couldn't satisfy node version 0.10.22" Which is odd because I don't specify a node version dependency anywhere.
Attachments
hello.tgz
(1.58 KiB) Downloaded 83 times
Memory in C++ is a leaky abstraction .

Heater
Posts: 17120
Joined: Tue Jul 17, 2012 3:02 pm

Re: resin.io

Fri May 29, 2015 3:08 pm

Seems the problem I mentioned above is a temporary fault in the resin servers somewhere. They are working on it.
Memory in C++ is a leaky abstraction .

tonywaite
Posts: 30
Joined: Sat Sep 15, 2012 10:13 am

Re: resin.io

Fri May 29, 2015 3:52 pm

Thank you for this.

Since your first post, I have been seduced into researching node.js - what a temptation!

Heater
Posts: 17120
Joined: Tue Jul 17, 2012 3:02 pm

Re: resin.io

Fri May 29, 2015 4:06 pm

tonywait,

Node.js and JavaScript are a wonderful thing. JS has taken over me and the company I work for ever since I discovered I could create the same server side functionality in node.js as we had in C++ and it was of comparable performance whilst being a lot less code and easier to write and maintain.

We are now only left with C/C++ and Pascal for some nitty gritty stuff.

Go for it, I say.
Memory in C++ is a leaky abstraction .

Heater
Posts: 17120
Joined: Tue Jul 17, 2012 3:02 pm

Re: resin.io

Sat May 30, 2015 2:45 am

The resin build system is working again. A couple more observations:

1) It's nice that whilst resin is updating the application on the Pi the old version keeps running until the new version is fully downloaded and configured.

2) I discovered how to restart an application in a Pi (the seems to be no specific way to do that in the console interface)

What you can do is set environment variables for the application. Turns out that when you set those the app is stopped when they are sent to the Pi and restarted, bingo we have achieved our aim.

My new resin hello web server is attached.
Attachments
hello.tgz
(2.37 KiB) Downloaded 89 times
Memory in C++ is a leaky abstraction .

alexandros
Posts: 4
Joined: Fri Jul 04, 2014 7:47 am

Re: resin.io

Sat May 30, 2015 8:52 am

Hey there, resin.io founder here, happy you like what we're building.

The terminal works the way it does because it puts you into the container, and the way Docker works, containers without an active process are terminated, so the terminal has nothing to attach to. We are preparing new images that always stay alive so as to improve the experience on that point. Also coming soon is per-device app restart.

Happy to hear any more feedback you have, here or at hello at resin dot io. Happy Hacking!

Heater
Posts: 17120
Joined: Tue Jul 17, 2012 3:02 pm

Re: resin.io

Sat May 30, 2015 10:59 am

alexandros,

Great that you pop in here.

I do like what I have seen of resin.io so far, I do hope you can maintain the simplicity of use as you carry it forward.

The terminal is not such a big worry. On the subject of terminals and restarts etc I was wondering about robustness. Does resin make use of the watchdog? Or can we make use of the watchdog from within applications? In general IoT nodes need to very resilient.

I was wondering about pricing. Naturally I think they are a bit steep but that's just my feeling and I'm no marketing expert. I can't help thinking there is a big jump from 5 devices for free to 25 devices for $60. Given the vanishing price of hardware now a days this seems rather a lot. I can soon deploy 5 devices around here but the jump to $720 per year for a few more is a show stopper. I'm thinking that less of a bump at the low end would attract a lot more small scale operators and make it up in volume. In fact what about flat pricing no matter how many devices? Think of all those millions of Pi out there that might love to use resin! Still like I say, I'm no marketing expert.

I'm signed up at the resin.io forum but I thought I'd start a thread here just to spread the word a bit because I think it's a neat idea.
Memory in C++ is a leaky abstraction .

alexandros
Posts: 4
Joined: Fri Jul 04, 2014 7:47 am

Re: resin.io

Sat May 30, 2015 5:56 pm

You can make use of the watchdog from within your application as normal. Since we don't know what your application does, it's hard to judge whether it's working correctly or not.

We generally try to keep pricing in line to "much less than you'd need to build something equivalent". That said, we're preparing something *much* nicer for people working on non-commercial, open source applications. One of the big problems with IoT is the diversity in business models and use cases. You can easily imagine cases where $60 is negligible, and others where $60 is impractical.

The business model is something that will go into action in the fall, and we are very very grateful for all the feedback we can get. While I can't promise anything, we are learning a lot and there's a chance we might modify it before it comes into action.

Heater
Posts: 17120
Joined: Tue Jul 17, 2012 3:02 pm

Re: resin.io

Sun May 31, 2015 3:52 pm

alexandros,

Great, I will look forward to the *much* nicer :)

A couple more issues/questions:

1) It would be nice to allow hyphen and/or underscore in application names.

2) When accessing device via it's public URL on failure what about someting more friendly than "Internal server error"

3) How can I see the config of my devices, after I have forgotten, things like wifi/ethernet, hdmi/not and so on?

4) What happens when resin dies? Having deployed hundreds/thousands of devices via resin how do we continue if resin.io disappears?

By the way your blog about Angular and D3 was fascinating. I have recently been puzzling over those same issues with D3 used with React.
Memory in C++ is a leaky abstraction .

alexandros
Posts: 4
Joined: Fri Jul 04, 2014 7:47 am

Re: resin.io

Tue Jun 02, 2015 3:15 pm

Hey -- glad you liked my Angular/D3 article. It felt like a philosophical meditation firguring this out at the time and it's good to see it get read a lot even now.

To your questions:

1) App names are used across the infrastructure (git endpoints, docker registry, on the device, etc) and each system has different constraints, so we have fallen back to lowest common denominator. We have thoughts how to relax this, but it's a low priority item given everything else on our plate.

2) Agreed! We have a fix for this merged internally, expect it to be fixed in the next week or so.

3) This is something we recently realised is needed. It's quite a complex feature to build, but we do have it on the roadmap for the next few months or so.

4) A great question! We've been wondering a lot about this ourselves. I hope it's a "if" not "when" as a lot of the work goes towards making sure resin.io is always around. We are seriously examining releasing an open source version of resin.io that should be a drop-in replacement for the hosted service. There are internal pieces to move still, but my hope is that we will be able to do this, which allows users to trust that they will always have a way forward.

Happy to answer any other questions you or anyone else here has. Ask me anything! :)

Heater
Posts: 17120
Joined: Tue Jul 17, 2012 3:02 pm

Re: resin.io

Wed Jun 03, 2015 6:41 am

Alexandros,

I was up most of the night getting my camera module working with resin on a Pi. Mostly problems at my end, corrupt boot partition and a very intermittent 3G connection to the Pi.

I seem to have had half the resin team advising via the built in chat, Shaun, Lorenzo, Alexis.

A big thanks to them all.

So my "Hello World" for resin.io, a Pi and a camera is online here:
http://bccbb0d6f38d1c3dec17eaeddc737106 ... .resin.io/

If anyone wants a simple working one page camera server resin.io example the code is attached.

Given that enabling the camera requires manually tweaking the SD card image I was wondering if that should not be automated with an option when creating a new resin application.

How hard is it use resin with a platform that is not currently supported? I have here about a dozen IGEP industrial ARM boards from ISEE https://www.isee.biz/products/igep-proc ... pv2-dm3730. I would love to be able to use resin with those. Perhaps we could think about using resin commercially with those.
Attachments
hello.tgz
(2.9 KiB) Downloaded 71 times
Memory in C++ is a leaky abstraction .

Return to “Other programming languages”