IOT on SAFE network

IOT is a $235B industry, expected to grow to $520B in 2021 (see forbes.com) and from my experience IOT could benefit from something like SAFE. Putting up even a basic monitoring device like a weather station is definitely not a solved problem yet imo, it’s still a messy ecosystem full of complex decisions. Having a great library for IOT devices to talk with SAFE would be very handy.

There are some considerations we can make right now about IOT and SAFE.

Device Support

Libraries for devices should be simple and lean.

Raspberry Pi is very simple to set up to use with SAFE, which is great news. It feels almost too easy. MaidSafe have done a great job with this subset of the IOT in my opinion (ie ARM SOC).

However cheaper microcontrollers such as ESP8266 / ESP32 or LinkIt7697 have a few challenges.

On-board memory is too small, usually a few MB maximum. A simple upload/download app for SAFE compiles to about 15MB so cannot fit on these microcontrollers. This could be addressed a few ways.

  • Wait for microcontrollers with more memory but same price point.
  • Simplify the SAFE library so it fits onto devices with less memory.
  • Add an SD card to the device, split the operations into smaller sub-units and load each sub-unit into operating memory as needed.
  • Ignore very cheap devices (ESP8266 is about $2) and use a slightly more expensive one (Raspberry Pi Zero is about $20).

Lack of filesystem or ways to manage and load the configurations. This means hardcoded values may become obsolete over time, difficult to update, or proxied in a potentially insecure way. This mainly affects bootstrap client IPs, wallet keys, login credentials etc.

This means a potential IOT-specific SAFE library should be flexible and not require configuration as either specifically files or specifically as hardcoded parameters. By default the library should ensure private information is difficult to be accidentally checked into version control or published publicly. Managing secrets on IOT is currently very poor and a well designed IOT+SAFE library could make a huge difference to that problem.

Language Support

Rust is great and can be cross-compiled and supported on many platforms using LLVM. However rust isn’t easy to use with popular IOT environments such as the Arduino IDE (using C/C++) or Espruino (using Javascript). How can this language compatibility be overcome? Maybe a toolchain can be used (eg esp-rs) to transpile rust to other languages? Or maybe some other bindings will become available for compiled rust? Or maybe the library will exist in multiple simultaneous languages? I guess my point is, the language of the library (ie rust) is currently a barrier for using with most microcontrollers, but hopefully in the future this won’t be the case. We can start considering that now (and I feel the frontend team actually are considering it well).

Perception

These challenges pose a fairly significant question: should IOT devices use a proxy to SAFE rather than communicate with it directly? This means introducing a server to pass data coming from IOT devices onto SAFE. Not a big deal perhaps on face value, but it communicates a certain purpose and use-case for SAFE that I’m not comfortable with. SAFE should ideally be a native layer of the internet, not an overlay that’s used for only for special purposes. Can we make that happen? Can you think of other things that are currently getting in the way of deploying IOT devices onto SAFE?

I was hoping in this post to demonstrate a simple weather station on alpha-2 using an ESP32 chip with a DHT22 temperature sensor but it’s too difficult to pull it all together just now (I learned a lot though so no point wasting that experience, hence this post). I’m going to instead get the temperature monitor going with a raspberry pi just so there’s something live, but to me the minimum bar being rpi (ie the exclusion of ‘real’ microcontrollers) is not the vision I have in mind for IOT+SAFE. I’d be keen to hear your thoughts.

21 Likes

I wonder if this isn’t the case with many IOT applications already (eg home automation) where the sensors are IoT devices and talk to the internet via the control unit. In essence the sensors are not “Internet of Things” but rather “Intranet of Things” with a gateway. Rather like your weather station idea. At this time it would only really be possible with the sensors being on a intranet to say a RPi for any Internet traffic (SAFE or otherwise).

Not until the IoT devices have the memory/grunt will we be able to see SAFE natively running on these devices. I guess IoT is in its early stages like in history we had digital electronic boards having discrete components for such things as voltage sensors, current sensors, whatever sensor. Then discrete chips for memory (maybe 256 bytes or a few Kbytes) and a microprocessor chip. Then the whole board might then communicate with a min/mainframe computer to store/analyse data. Then as time progressed then we saw many sensors being put on single chips and eventually the microcontrollers were made with most of it on one chip. I am speculating that this is still progressing with say the ESP8266 which includes WiFi and will continue with more capabilities (memory/E2Rom/SSD/Etc) and in 5 to 10 years this will not be an issue since your small microcontrollers will handle the SAFE code without issue.
Thats my take.

10 Likes

On ESP8266, to avoid hard coding everything a technique like this can be used: Tutorial:Storing WiFi Configuration On Your ESP8266 Using The EEPROM Library Made Simple Part 1 — The Arduino Maker Man

Beyond that, I’m wondering what chips we’ll see with integrated 5G. There are always headlines on how 5G will be the next big thing for IoT.

Shout out to SAFEthing

11 Likes

Oh nice! Not sure how that one slipped past me, it’s great!

9 Likes

I expect that much of the motivation for product developers to introduce IoT into their products is so that they themselves can capture usage data. IMO, we are a long way out from decentralizing that data unless such is mandated by one or more governments (and I seriously doubt that will ever happen).

So as @neo suggests, I would assume all IoT data will go through a central server somewhere. If, after that, some of the parsed data is sent to the owners Safe Network account then that would be great … honestly though this seems a long way off to my mind.

2 Likes

Yes I think IOT has a lot of possible architectures. I’d like to see SAFE as close to the sensor as possible so that if one sensor fails the others can still log. If the gateway goes down all sensors would stop logging. But it feels to me like this will sort itself out over time anyway as libraries and microcontrollers progress naturally.

2 Likes

Connecting directly to the internet rather than a local meshnetwork using something like ZigBee or Z-Wave will usually drain batteries faster. Running SAFE would use even more power, but for devices that’s not battery powered it could be useful to be able to connect to SAFE directly.

If the connection is through WiFi the WiFi could be down at times though,just like the gateway or control unit could be offline. Using cellular might be the best for maximum online connectivity, with 5G coming up that should increasingly become the case.

4 Likes

Yes I am wanting this too. But I feel (as I said before) it maybe a few small years yet till we have cheap but capable devices to do this. Already we have ARM devices with 2GB on board the CPU chip and just need the “ROM” size to go up (from zero) then we will have a cheap chip with all the needed power to run SAFE in a cheapish chip (<$20) which will go down in time. That current chip has network & USB also onboard but no WiFi. So an IoT device would need

  • The ARM chip
  • WiFi chip or 1000 BaseT connector
  • USB connectors if desired
  • Some solid state memory

This setup is less than 40$ US and runs Linux, add sensors and supply power and off you go. Yes still costly for many applications/sensors but shows that in the last 5 years we’ve gone from

  • underpowered CPUs
  • Lack of RAM
  • Costly ROM memory
  • costing a few times as much for something that would not be enough

The next 5 years should see

  • CPUs
    • cost less
    • more RAM (2 to 8 times as much)
    • maybe WiFi included
    • ROM included using some programmable technology. Maybe even 16-32GB SSD style
  • external storage sizes increase for much less in price.
  • more sensors on chips

So hopefully see less than $20 for a smaller than Pi but more powerful than Pi true IoT device (maybe all on one chip)

1 Like

There’s a number of things that would be useful to use SAFE with IoT, especially for home automation

One is to have support for persisting data with home automation systems like OpenHab and Home Assistant.

Another, more what OP is talking about, is having support for IoT devices to talk to SAFE directly.

Lastly, standard for devices to store data and communicate through SAFE. If data formats are standardized it can make it much easier to support new devices in for example home automation systems. At the moment, cloud connected devices sometimes have APIs, but in terms of standardization there’s not that much apart from IFTTT. More and more devices are supporting IFTTT now, but it has a lot of disadvantages. It’s cloud based and controlled by a single company, with all the problems that has. A SAFE based IFTTT alternative would be great, maybe SAFEThings can become that.

5 Likes

I’ve also noticed that many manufacturers of housing equipment, appliances etc are now jumping on the “smart device” bandwagon, but struggle with security and reliability. Cloud servers that keeps going down (for things that really should be up, like fire alarms, water leak alarm etc), data from devices being completely open to everyone on the net, control of devices not being properly secured and so on.

These companies still mainly make money on their devices, so I guess they could be open to using SAFE. Even for those using subscription models to their services, they could still do this while using SAFE.

2 Likes

Unfortunately these companies are making a ton of money from the data they can collect. There have been a number of home automation companies providing solutions that collect every bit of data they can. Including your movements in the house (keys w/fob, phone tracking, sensors, usage of various control pads, light switches, and so on) and while not perfect its still data they can sell.

Collected data is too juicy for them and why new companies have sprung up pushing this.

Its rare now to find companies selling these new style smart home automation systems that only send alarm data back to the company’s databases.

So I am hoping that with SAFE there will be companies utilising the privacy that SAFE can provide where only data required for security (ie alarms) is ever sent back to the company so they can action the alarm. But all other data is kept private and only the owner (family etc) can access any data, preferences, etc

4 Likes
5 Likes

I wonder to what extent more traditional manufacturers are selling data. Nowadays new appliances from Miele, BSH (Bosch, Siemens…) and many more often come with built in WiFi. They could sell your fridge temperature,when you’re washing,cooking and stuff like that,but is that data that interesting? They may have found ways to monetize it I guess.

1 Like

Might be good for statistics (legal use, anti-privacy still)

But hackers would love it. They know when you are definitely home because you open the fridge, or use the controls on your stove, washing machine, etc.

1 Like

I am on board with this. I have been raving about IoT.

The potential is massive for a security and crypto project.

EDIT

Sorry was busy at work could not finish my post.

So although I am not a technician I have worked in roles for manufacturers that work on IoT and can shed some light.

Regarding the central server model this is correct. When I was at Bosch they had their own cloud they were working on which is basically just a central server model, I believe if I remember correctly they were using AWS. Some info here Knowledge center of Bosch IoT Suite

Bosch began working with IOTA when I left and if I am correct IOTA also uses a central server model.

I am currently working for a local Australian manufacturer that is now entering their product into the IoT realm.

To answer @TylerAbeoJordan point the motivation for devs is, yes to collect data for themselves but don’t forget that they can already do this to an extent, but that is not the core motivation, more so the real motivation is MONEY - better products to market and compete on, because in the IoT case the market as a whole is crying out for data. Everyone wants access to data, businesses, governments, individuals. To the point companies are creating gimmick products that don’t really do anything, check out ONE-KEY™ | Milwaukee Tool Australia it doesn’t do much at all and yet they are selling like hot cakes.

And yes you are correct we are a ways out from decentralizing it, but I do not think it is as far a stretch. Local governments in Aus are pushing very strongly for data and do not forget they are funded by rate payers and so I can see them giving rate payers data and in a sense kind of starting off the decentralized model but of course they will have security concerns.

@intrz you are correct cellular seems to be one of the go to’s in Aus anyway. In Aus, Telstra is installing a narrow-band network, many of us think this along with Lora will be the two big techs to ride with the IoT data, I have heard Sigfox will be big in the US.

@neo or @intrz care to help me get NAS or similar into everyones homes in Aus? :wink:

They key angle for us I think should be secure decentralized hosted data (I know we all hate that word, hosted, but it works well here) and at cheap rates. Have a look what people are going to be charged currently, its a mess, some manufacturers are charging through the nose for IoT and others haven’t even thought about it.

I see SAFE partnering with someone in this space personally.

That and or us providing small safe devices that home users can use to store personal data on but also use as a hub for their IoT data and communications.

I’ve mentioned before we should touch base with the likes of https://www.thethingsnetwork.org/ in fact I was personally meaning to but with my lack of in-depth technical know-how I was kind of hoping someone else would.

4 Likes

An option for power users to use SAFE is to make the device connect directly to SAFE or a local gateway that connects to SAFE instead of the manufacturers Cloud.

An example where something like this has been done is Mitsubishi Heat pumps, it got a connector for a WiFi module and the DIY community has figured out what data comes from it and made descriptions and code for making your own module that can connect to your own network instead with WiFi, ZigBee or whatever you want instead of Mitsubishi’s MelCloud. Many other devices have WiFi modules that are connected with some connector to the main electronics board and could in theory be replaced with a custom module.

If the device connects to the cloud via HTTP, a man-in-the-middle proxy can be set up to trick the device into thinking it’s talking to the cloud, while it’s actually talking to something like a raspberry pi which instead could store the data on SAFE. It’s more tricky if the device uses HTTPS as that may require inserting a custom root certificate on the device. That can be done by loggin into the device with ssh etc if possible. Sometimes devices stores certificates on SD cards and the SD card can be removed to install a new certificate. Certificates can also be stored on some on-board chip making this very difficult though.

3 Likes

I’m maybe being a little cynical in my thinking but I have the feeling that the BMS/BEMS manufacturers will be pretty protective over what they consider their data. The likes of trend don’t seem that keen on letting that logged data out of their grasp. I could be wrong.

2 Likes

5G will be excellent for both the SAFE network and IoT, but does anyone really believe big corporations want to be dependent on the telecom companies for 5G access? I don’t think so.

Thought I would re-ignite this conversation.

I was just privy to an interesting conversation by a SAP representative and one of my companies directors about the security concerns they are having with IoT.

Essentially our company works with an IoT technology firm to stick their modems into our device and broadcast the info, they also supply the user front end app and website dashboard. We use SAP internally as our enterprise software for order process, operations, accounting etc. These IoT folks are pushing to integrate with SAP but SAP being very German and very privacy and security focused is concerned about security issues as they have tested a few IoT systems and they have had 3 security issues already. This is locally in Australia. I assume globally it is even more.

I think we need to jump on this as soon as we hit Beta.

IoT is going to be in the billions of devices very soon and there are massive security issues with it if you think about it, random IoT devices on roads, in cars, in the street, in malls and shopping centers, connected through gateways or cell towers to company and government servers…its a disaster waiting to happen.

PS for the mods not sure but maybe we need to connect this thread to this one: Internet of Things (IoT) and SAFE net - #17 by neo

4 Likes