onsdag 30 november 2016

More kinds of sensors and how do they work? What can you do with them?

I went through the rest of the sensors on Elfa. When I didn't understand what a sensor did or what you used it for, I just googled.

Redox-electrode from Elfa
What's a Redox-electrode?






 https://www.wikiwand.com/en/Redox
The link contained a beautiful gif of how it works on an atomic level:

Beautiful visualization from wikipedia

Reed-sensor 
What's a Reed-sensor?


Youtube has the answer:

Current transformer? - Clip it on a cable and it senses how much current there is!
https://www.youtube.com/watch?v=IHozA4Ds5Ts

Thermo couple

Thermo couple? It measures temperature. It's just two welded wires?!?!
https://www.youtube.com/watch?v=rznBiteUy2A





Absolute encoder? -It measures angles using a beautiful disc with an important pattern.

Open it up and look inside:
https://www.youtube.com/watch?v=JwU_DrI_Mmc







I also looked at the standard motion sensor. It's pretty smartly done.

"If it's not made by card access, then somebody else made it"

 I don't know if you can call this market analysis? This is pretty fun.

I'm getting a hang on what you can do and what kind of problems you can easily solve with the electronics available.

tisdag 29 november 2016

Sensors, what deserves to join IoT (internet of things)

Today I looked at different sensors to get ideas of what you can connect to the internet.

I just looked through some sensors on https://www.elfa.se/en/automation/sensors/c/cat-L2D_379612


It's a new world for me, I think this is opening my world of what is possible. Before I could do anything on the screen, in VR or sound from a computer by programming. Now I can enter the real world and make robots to conquer the world.

I think it's very interesting with sensors, I think about the biological sensors we have in our bodies and how intelligence is used to process the input into interesting actions.



 Maybe in the future I can help build some kind of all-purpose cell-thing. It's like a human cell with DNA that tells it everything about how society is run. And with small parts it can take on the task of beeing some kind of fireman-cell-robot or a cleaning-cell-robot.

It would probably be more usefull if it could go on wheels and legs. With a 3D printer and moving parts that can move the 3D printed parts (like a new arm-part). It should also be able to recycle parts like the arm, to 3D print a IR-sensor or whatever it needs.

Like a human cell, be able to become anything in it's DNA. Anything that could be needed. And connected wirelessly to all of the other cell-robots. What could go wrong?


Tomorrow I'll focus on looking for more sensors and find problems that could be solved by connecting sensors to the internet.

And who needs it?

måndag 28 november 2016

Marketinganalysis, project management and competition in home-alarm systems

Today I've planned a little marketing-analysis and started looking at competitors products and prices. I don't fancy this kind of work much, but it has to be done.

I went through some marketing-slides that I've got from the marketing-course on folkuniversitetet (it was a part of my programme). Our teacher there Nico Allergren was very good and relaxed. From the slides I made a litte todo-list in kanbanchi which is a nice site.



Lägg till bildtext


You can easily use kanbanchi with google drive
It's very nice that you can easily prioritize the tasks (drag and drop), not like in excell.


I wrote a little document (in swedish) to get me on the right track.

It's just the first task in the kanbanchi. To define why this marketing-analysis is good for.




 Right!

Onto the competitors, how do I find them? How does the customers find them?
-I just googled

Prices for home-alarm systems:

A security-system connected to your smartphone costs around 2000-8000 SEK. to install. After that, you can pay from 80-400 SEK för a service that monitors your alarms and takes action if there is a burglar, fire, water-leak or a wet firebreathing burglar there.

I also found this fun thing you can do with your kids (video in swedish)

fredag 25 november 2016

Effective handover-meeting and SSH-tunneling

Today we started the day with a meeting. Tomas came by and we asked a lot of questions. Much confusion and information flew in the office.



When the meeting was announced to take place, I created a document to write down all the questions I had. So I would get the info I needed as much as possible. This was very usefull.

Apparently files I needed to access was on a server where a password was forgotten. There was a green sd-card with the same files on it but it seems impossible to crack...



The files where impossible to open in windows, it just loaded forever... So we tried installing vm ware workstation, mounting a virtual ubuntu to run and opening the files... But to no avail. First I got an error where the sd-card crashed the vm ware workstation. Then later it started bluescreening the computer. this is getting a bit interesting...

Anyway I learned a lot about what servers they use and where data is stored and how to get it. I also learned that the r-pi is just going to take the raw data from the can-cards to upload it to the MySQL server.


SSH tunnel

After leaving the files I just looked and programmed some python to create the SSH-tunnel. It was quite easy but one problem occured. I had switched the name in the port-title or whatever with the number.

It should be:
test-123.mysql.binero.se
not:
123-test.mysql.binero.se

This was tricky because our domain provider had the wrong as a standard and just used the other combination when making an ssh-tunnel. Anyway, it was solved by going through every possible thing as usual.

Python MySQL

So when I got that working I got the MySQL commands to work in python as well.


# execute SQL query using execute() method.
cursor.execute("SELECT VERSION()") 
 
>>> "5.5.42-MariaDB-cll-lve"
Yay!
 
Next week I have planned to make a marketing-analysis... We'll see how that goes... I just do it because it's needed for passing the program I'm studying. Not really keen on it. 

torsdag 24 november 2016

transfer files via ftp to r-pi and access an SQL-server






FTP


So today I've made it easier to program and change files on the raspberry pi (r-pi). 

Be aware!
 The only thing someone needs to hack a raspberry pi (with raspbian) is the ip.

ssh ftp is already installed on raspbian and the username and passwords are a set standard.

So the only thing you need to change files on it via ftp (sftp actually), is the ip-adress.



I have changed the password now, but it was tricky. There are a lot of passwords you can change (I have found 3 so far).

First I tried to use the terminal and be like the geeks i know. But that password I changed wasn't the right one.

But if you simply go via the GUI in raspbian you can set the one connected to sftp.

And then I just installed filezilla (client version) on my own computer and felt good about myself.

SQL


I made an MySQL database on our domain, something, hoster. When I wrote a program to access it, it wouldn't work!

_mysql_exceptions.OperationalError: (2003, "Can't connect to MySQL server on 'xx.xxx.x.xxx' (10060)")

Python program:
 #!/usr/bin/python
import MySQLdb
db = MySQLdb.connect("xx.xxx.x.xxx", "username", "password", "database", port)
cursor = db.cursor()
cursor.execute("SELECT VERSION()")
data = cursor.fetchone()
print "Database version: %s" % data
db.disconnect()


What was wrong? I googled it furiously and everything seemed fine.
When I was going to look at our domain hoster for help, I found out that I need to make an SSH-tunnel before making SQL-commands.

That's probably what I will look at tomorrow.



onsdag 23 november 2016

Gantt chart and SQL-play

Today I made a Gantt chart because it was needed to pass the course. It seems like a simple nice way of visualizing a project.


It's in swedish.

I also made a todo-list to complete the first activity "Larm-server kopplingsmöjligheter"


Larm-server kopplingsmöjligheterKlart


Förstå SQL-server (skapa databaser och sql-formattering)
Förstå hur SQL-server borde vara uppbyggda för projektet
Förstå skicka SQL-requests med raspberry pi (python)
Förstå skicka SQL-requests med raspberry pi (linux hax?) (Tomas-metoden)
Förstå input från Can-kort
Få hemsida/server att skicka mail

I first helped a colleague with programming some python to send out pulses to a LED.

Then I tried to understand how to work with python and SQL. I made a program using the library sqlite3.

I also installed sqlitebrowser to check if the .db file contained the shit i tried to put there.

It did!

However, I don't know if I can use sqlite when communicating to a MySQL-server... And I don't know what kind of passwords or security I need to have to access the server. So that I will probably check tomorrow.

Currently I'm programming on the raspberry pi itself, it's not superfast. So I will probably make some ftp connection so I can program on my computer and upload the code to the raspberry. Maybe I should put git into the mix as well.

tisdag 22 november 2016

Day 1-3

The first day I just visited and we talked about the LIA and what I could offer and what they could offer.

The second day we decided I'm going to work on the alarm-system. We talked about the current system to monitor breaking an entry. It uses a raspberry pi with some linux-hax. The idea is to connect the raspberry to can-cards that monitor windows and update an sql-server with the statuses of the windows, doors, etc.

Third day
Today I've been installing raspbian on the raspberry pi and trying to figure out how the sql-database works.

The raspbian works well!

But the sql gave me an error when I tried to make a user in a wiki:

"#1048 - Column 'user_name' cannot be null"

Init

Hey folks, making a system for alarms.

I've currently studied app development for mobile devices at Folkuniversitet in Umeå for almost 1,5 years.

 Bildresultat för folkuniversitetet
Now it's coming to an end with a LIA (Lärande I Arbete) (Learning at work). I have been accepted at Kivo AB in Örnsköldsvik. It's a very nice place and I look forward to this LIA. They have a bunch of interesting projects and we've decided that I'm going to work on an IOT-project.

Bildresultat för kivo ab

IOT (Internet of things): Everything is beeing connected to the webb and you can even email your lawnmover.



This project is about a system to handle alarms. All kinds of alarms:

Bildresultat för alarms
Breaking an entry-alarm
Moisture alarm
Chicken food eating alaram







There are all kinds of things that we want to monitor but don't have time to. When the moisture in a warehouse becomes to high, we want to know this.

I'm going to use this blog as a diary to track my project. Every working day I'm going to post what I'm working on.