Almost every working day I've written a summation of the work as an intern at Kivo in Örnsköldsvik, Sweden.
The work I've done is a marketinganalysis about IoT, Systemdesign of a general IoT-surveillence system and troubleshooting the electronics of Kivos homealarm. Python, Linux, Raspberry pi, CAN, SPI, MySQL, PHP, Agile and workflows.
Today I've worked from home and tried to install a linux version on another R-pi. I just had a microSD with 1 gig and that meant I couldn't use Raspian or almost any other OS. I tried to install a really small one of 100 mb but it got stuck at the rainbow-screen at boot, so I dunno what's wrong. Im going to try using DietPi later.
I couldn't connect remotely to the one at Kivo, so I just looked at CAN and what that is.
So now I know some basics and what I should ask Magnus and the others about and what I should expect when figuring out how I can get R-pi to work with it using the CANUSB cable.
I'll be back on january 10
Then I'll check out CANUSB. Maybe get it to work with windows first to see what I should expect.
Wednesday and Thursday I looked at GPIO and tried to send some signals to a PCB called MCP2515. It didn't send any signals and didn't do anything when I sent it some signal.
SPI
Then I took a look at SPI on wikipedia and what it uses MISO, MOSI, CE and CLK for. They're connections on the R-pi.
Documentation like a pro
I also started to document everything really neat. Since all this electronics and hardware close programming is very new to me and I can't learn fast enough or keep everything in the head, I needed to document somehow what I did. This helps me know:
what tutorials i used
what I have done to the system, in what order
what the problems where on the way
how I've solved the problems
The way I did this was like this (mixed swedish and english, I should probably choose just english):
I made a folder called "Changes on R-pi" and made a document for each separate thing/user story I tried to get working. The picture shows 2 Tutorials and how I started using another tutorial after I got stuck with the first one.
Title: title of tutorial
Link: to tutorial
commands done in linux (raspbian)
Swedish text: Comments and guiding like "I didn't install 'wheezy' or 'Couldn't find the file, so I jumped to the next tutorial'
Table: Error/result output messages
I'm quite pleased with this system. I can easily find any information about what I have done previously, so I don't have to keep anything in my head at all.
Ofcourse it migth take time to work like this but I think it's worth it in the long run. I will become a master of all of these things faster.
Digital oscilloscope
Me and Magnus used a digital oscilloscope to measure output and input on the SPI on the connections between R-pi and MCP2515.
Larm at the top, connected to Oscilloscope to show graphs about SPI signals. My laptop remotely running SPI-scripts on the R-pi in the Larm at the top.
I'm really happy that we could read signals from the R-pi, that probably means I did something right. And we found that the PCB isn't responding anything (just zeroes), we think it might be broken or that we're missing something...
CANUSB
The system uses CAN and connects to R-pi via the PCB right now. There are these cord converters from CAN to usb that we might use instead of the PCB. In a way it seems simpler.
Today I'm working from my home, noone is in the office. This gave me some time to do Falun gong but I can't work very well with the system. But I borrowed a R-pi home and am going to rehearse what I've done by setting it up just to try, read up on CANUSB and maybe try to communicate a bit differently to the PCB.
I used dataplicity to connect and start a vncserver and then filezilla to transfer files, since the raspberrypi connected to the windows, doors, motiondetector, sound and light is stationary on the wall and there is no monitor there or a desk to sit at. It was troublesome since I had to start the vncserver with the right user.
Then I started the big journey to understand GPIO. There is just so much stuff I've looked at and going to look at some more tomorrow. I have no idea what signals comes from the connections or how to interact through python. I'm probably going to read up on the terminology and then ask a lot of questions.
Tomorrow, looking more at GPIO and try to get a python-program react to the input. Like print "now is window open in Andreas office"
Today I've looked over the userstories with the boss (Andreas) and put them in a backlog. I estimated them roughly and let him prioritize the backlog.
I was very generous with time, since there are some things I just don't know how easy they are.
The first item prioritized was "Backup" which first I estimated to 5 storypoints. Which is rougly a day. That was a bit of an overestimation, at first I thought about version control, and some automatic saving on some server. But when we talked about it, it was enough with just a folder somewhere. I decided it to be on my google drive and that was that.
Next userstory was:
"As an owner of premises I want the alarm to go off if a window/door opens or the motiondetector senses motion (when the alam is on) Så that I know when someone enters"
This I first estimated to be almost a week of work. When I divided it into tasks, the time went down to half a week.
The red line is to long...
The first sprint will be until friday, so I might be done this first sprint with the very basics.
The hardest part was to connect the micro-SD card to the stationary raspberry pi. I couldn't see the backside where the connection was. After some fiddling, I googled to get precise location of the connection and realized it was regular SD for this version. -.-'
Tomorrow I'll be looking at how to work with it through the terminal and get filezilla to work nice. After that, I'm going to look at GPIO.
Today I've been working on the userstories for the homealarm and played around with making a server out of a Raspberry Pi. Usually you do it with the product owner, but this time the system is so simple and I already know a lot of what needs to be done. So to save some time I'm going to write a set of them and check with my boss/product owner to see if anything needs changing.
When I started writing userstories I was done so fast. Then to see if I made some good stories I used INVEST.
I had made a userstory like this:
"As an owner
I want to be able to see if devices are online or offline, from anywhere
So I allways can check whether it's working or not"
I realized that it might be to big for me on the S-scalable point of INVEST. "from anywhere" means I need to make a webbsite accessible from anywhere. I could maybe cut it down to 2 sepparate stories.
"As an owner
I want to be able to see if devices are online or offline
So I can check whether it's working or not"
This would let me have the status available by attaching a monitor to the R-pi. And then later focus on making an online everywhere-accessible server.
And why this trouble of dividing up? Because of MVP and agile. Building the smallest possible thing first is of great value when thinking agile.
So well after this I let it be for now and focus on learning about how to decide what's the best solution to see offline/online status at an MVP-stage. I focused on understanding if it was possible to make a server on the raspberry pi that could easily be accessed by a computer connected on the same local area network and wanted to see how hard it is to get it online on the whole internet.
I did it and learned some django on the way. I also connected it in a simple way to the internet completely so I can work from home, as long as the pi is on and online. But how exactly to set up a website that runs online on the whole internet I need to check up. If we need to change settings in a router and the broadband, it might be a lot of trouble it the product is going out to customers with all kinds of internet distributors and routers.
Really nice videos on Django and python
Getting the raspberry pi online and editable on the local area network: https://www.raspberrypi.org/documentation/remote-access/vnc/
Getting the raspberry pi online on the WHOLE internet:
https://www.raspberrypi.org/documentation/remote-access/access-over-Internet/README.md It was supersimple using dataplicity but you are restricted to a terminal there. So it's not as fun.
On monday I will check the userstories if they are suitable and continue setting up for scrum. I also need to see if I can get a webserver running without configuring the router or getting a static ip.
Today I've been repeating scrum and agile to write userstories instead of a requirement specification.
I chose to continue to work on the requirement specification since it was almost done. And instead use userstories for an implementation of the more general IoT-system.
So I've done a first version of requirement specification for a general IoT-solution which can be used when developing products that should be IoT-connected, in order to supervise the offline-online status of the products connected to it. There are also other benefits. A webbsite could be included in the package to show actual status of units. Graphs of data could easily be accessed online as well.
Kivo IoT surveillance system shows what units are online and which ones has lost connection.
This example is of video-cameras. But the IoT-surveilance system can be used for many other systems.
Measuring temperature, moisture etc..
The general IoT-system can be adapted to any IoT-product
System alerts user that their homealarm has gone offline
Look at graphs of temperature by visiting a website connected through Kivo IoT
As I started to write the requirement specification I realized it was a very wholesome document with all the features of the system. This is not very agile I thought as I realized I know a better way to do this. It's user stories á la Scrum.
So first thing tomorrow I'm going to look at Scrum again, it was a long time ago I did scrum. My school had the courses in the spring semester, so I really need to refresh my memory.
Then I'm going to migrate the requirement specification into user stories and then get to scrumming.
Yesterday I started thinking about the requirements of the IoT-system. It seems like it's going to be very dependent on the customers internet-connection. A big problem could be if the customers children often change the router-password, the IoT-system will try to reconnect but has to be reconfigured with the new password. This will not be a problem it it's wired. Otherwise, if the customer wants wireless, we might have to recommend an update to easily make the IoT-system configurable just for connection.
I also feel very confident about the system, it's fun to thing about these things and there are so many cool things you can do to make the simple to use. And once it's simple to use, everyone can joint the IoT.
Today I'm going to continue working on the requirements.
According to my planning I wasn't going to focus to much on marketing analysis, but I realized during the start of it that if I'm going to do it, I should do it properly. I planned one week for it but it has now passed 2 weeks and one day. Work has also gone to the PHP-problem. Maybe 3 days for the php-problem.
I have a better understanding of where IoT-technology lies, what it's used for, what kind of IoT companies, what kind of solutions, their target customers, our target customers, demands and possibilities of our new product, our productmix, a simple business model for us, what some companies charge and what we should and could charge.
This is valuable information.
I mailed some companies about what they charge for different kinds of products, it kind of felt wrong since we might be competitors. But we might become partners in the future if I focus more on software and big data and maybe installation and they just supply the hardware and database.
Tomorrow I will focus more on our product and start making a requirement specification for it.
Today I almost finished all the work with the mysql-php scripts. Uploaded the new files and it seems to work. I just have to fix the last mysql_results() and I didn't know exactly how it was used in the program so we decided to mail the one who made the system for some feedback.
Then I was working on the marketing analysis and found a finnish company named Wirepas. They have made de-centralized radio communications protocol.
They basically made an extra internet, for things. That is connected to the main internet on some parts, so you can access the data.
Looking forward to see what they are going to do in the future and maybe there could be a collaboration of some kind. It would be awesome to see if they have thought anything about sharing data.
And have they thought about sharing the internet but not sharing the data?
-If I have 10 wirepas-powered sensors and my neighbour has 10. Could my data travel through his IoT but be encrypted only for my eyes?
I looked at competitors and was trying to figure out their target group to sell to. I accidentially thought of googling "wireless sensors" and got a whole lot more work to do. It made me find 8 new competitors to analyse. They have really good products, maybe a collaboration is better. Often you have to learn their system to set it up and that could be a service to provide instead of making a new system.
Also I worked on fixing the mysql to mysqli with a pythonprogram. It saved me a lot of time but there where some things I yet have to learn about PHP to fix it.
I updated 68 of 70 files and tomorrow I will check if I did it right and learn som additional php to convert the last 2 ones which uses some weird php-arrow like:
def updateFile(fileName, replacementList): content = open(filePath).read() for word in replacementList: if word in content: content = content.replace(word, replacementList[word]) open(fileName, "w").write(content) if mySQLCheck in content: print fileName
currentDir = os.getcwd() for root, dirs, fileNames in os.walk(currentDir): for fileName in fileNames: if fileName[len(fileName)-fileEndinglength:] == fileEnding: filePath = os.path.join(root, fileName) updateFile(filePath, replacements)
Today I've worked from home. I finally listed all of the competitors that has products like wireless sensors that upload things to the internet somehow. If you are interested in the small list I have, send me a mail.
From there I could see that there might be a nice place on the market for a similar produkt. Especially if you do the marketing well.
Then I worked on setting up to update the php files. I downloaded all of the files, made a backup and started a local git-repo to keep track of my changes. Then I searched the file-content for "mysql_" and found 70 files...
I need to change like 4 methods and add a line of code to each file. (I think).
I started doing it manually but then I thought of making a python-program to patch it up instead.
One mystery thing is that I tried changing a part of the files yesterday and it seemed to work. I could upload something to a mysql-server and when i tried to upload something with the same id, it gave me an error talking about uniqe ids. But when I looked through the database I couldn't find the thing I supposedly made. This concerns me... But if I get that to work, it shouldn't be a problem to fix the other files.
Today I've been checking the news for perspectives on IoT. There is a lot about small things that can gain from IoT and that it is a growing phenomena to create connected devices. There is no bigger system to analyse the 'big data' that is coming in. Also the 'big data' could be bigger, but the information like gps on your phone or if your garagedoor is open isn't something that everyone wants to share. There is still work beeing done on a standard to connect everything.
I've also checked the bonus-work i got. It's on our server to see why the time-rapporting isn't working, and it seems to be because of old myslq-methods in php. I changed a bunch of them to get some things to work, it kind of works but you can't see stuff and I'm not sure you can upload stuff. It feels cool that I can figure out things so fast. There was a lot of files and I think I'll try using some kind of tool to change all the deprecated methods to new ones.
So today I worked more on marketing analysis and figure out what I'm actually suppose to be doing.
At the fika in the morning I mentioned my thoughts on the project and my general system got improved. Let's say the r-pi (or brain unity) is a burglar alarm and the unit is in the house in order to get the sensor-singnals from different sensors. If the electricity is cut, the brain-unit is shut down and can't send any updates. It is possible to have an external system that warns and sends messages if a brain-unit is unconnected. In such a case the external 'online intelligence' system needs to be programmed differently for different systems as well as the r-pi. It feels more modular if the brain-unit is less smart and just uploads info to a database. This way there is no question what system needs to be changed if an email should be sent, it's the 'online intelligecne'. All of the intelligence gathered on one secure place makes it easier to check for bugs as well.
If the database isn't updated, then the 'brain-unit' or 'relay-unit' it should be called now, needs to be checked.
The intelligence in turn handles who should be send what kind of info:
-Has the database registered an intruder? Send email to owner.
-Has the 'relay-system' gone offline? Send email to owner.
Disadvatages of this? I dunno.
So with this I have worked on a productmix that Kivo can offer.
Products:
Relay-unit
Sensors
Server database
Server intelligence
Server HCI (to monitor and program the intelligence)
Services:
Connecting an existing system to IoT via relay unit
Design and offer a new system connected to IoT via relay unit
Design a database
General installation-help
This way, any hobby-hacker should have an easy time to set up their own kind of system by using our sensors, relay and software. Also it should be easy to use the system for bigger companies combined with our services.
I'm thinking that there will be a lot of focus on marketing and explaining ideas and problems that can be solved. Also the interface that the user will interact with needs a lot of work. The biggest questionmark is what the intelligence should be doing with all the data. That will be solved by beginning to "think IoT", which I probably will start doing uncontrollably.
My first project as mentioned before, will be the alarmsystem, making a database and some kind of 'online intelligence'. After that I will focus on a simple interface to watch over data.
I also checked the prices fot other IoT things to see what we should charge. What about a smart oven that cooks everything you put in it automatically? Or a smart lightbulb-security system?
I thought that it
would be neet to have a IoT-productmix that you can easily manage
yourself. I started drawing what it would need and how it could work.
So a set of sensors like:
temperature
moisture
motiondetection
camera
etc..
All with an interface easilty connected to a sensor-unit.
An extra range unit in case the sensor units can't reach the brain.
A brain that is programmable. A simple way to program how it should act in different situations.
Send mail if temperature is over 20 degrees Celsius.
Send sms to other cars to watch out if the ground is slippery.
Create a dog-account if camera senses a dog.
?
Anything could be possible. A brainstorming-session could generate hundres of usages.
Also,
on a different note, there was a problem with time-rapporting on our
server and I was asked to take a look on it. This was unexpected and I
guess these kinds of things happen a lot on workspaces. I guess I have
to adapt to a more flexible way of working. The assignment was fun
though, I learned some PHP and there still work to do to fix this. But
it will probably not take much time.
Today I will
work on rounding off the marketing analysis and list answers to my
questions. Answers that will help me create a nice specification to work
from. I have all week to be done with the specification.
Today I've thought about the IoT and where I can find some problems to solve. I started to look at som inspirational videos and then thought to ask Övik if the city has any problems.
Let's talk about the internet of things first. It's an internet. But instead of just computers, everything is connected.
Your car can be connected to the internet of things.
Your cellphone is probably connected to the internet of things.
Your refigerator can be connected to the internet of things.
What's the point?
Connecting everything and making them talk to each other, changes everything...
A good introduction to IoT
More abstract and absolutely beautiful video of IoT
I think there is still so much to do. And the bulk of the work is figuring out what to connect, what problems it will solve and how to design systems that speak the same language, so they can actually solve problems.
I continued to look for trouble (hah), and thought of asking Öviks kommun. I saw on the website that the "comments and compliants" are open to the public, so I called to see how I could get at it. They where a step beyond! Apparently they recently implemented a system for users to report problems on the site that let's the user place a pin on a map and choose a category. This map is available on the site! I think this is really cool.
Maybe a good idea is to automatically analyse the complaints and send emails to the right parties directly. Also it you connect you car to IoT, it can automatically send a complaint if there is a slippery road that needs to be sanded! A car could totally figure out if it's driving on a slippery road... There are so many things that can be done. I just need to find that really good thing that everyone really needs.