Elektor Chip E-Lock Reference Project [130499/130280]

Here are some goodies (source code, tools and documentation) to play with the Elektor E-lock* Secure Server Board (130280).
Here are some goodies (source code, tools and documentation) to play with the Elektor E-lock* Secure Server Board (130280).
- Connect the Secure Server Board (SSB) to the same network as your test computer.
- Run ISLRaw.exe to find the SSB. Once found, you can attribute it an IP address.
- You will be asked to load the server certificates. Make sure you have (created) valid ones. See the documents below for details on how to create certificates.
- Run ISLElektor.exe to connect to the SSB and play with it. You must enter the IP you setup before and port number 2013. Then clic connect. Connecting can take up to 20 seconds.
*) Buy the E-lock in the Elektor shop: http://www.elektor.com/130280-91
A Microsoft Visual C++ 2010 Express project is attached below to show how to communicate with the server. It is a command line utility that takes the server IP address and the port number (2013) as parameters. When the certificate and key files are valid it will connect to the server, switch the relays on, wait one second, switch the relays and disconnect. You can use this project as a starting point for your own applications.
The server commands are detailed in the attached documents.
The project includes parts of the open source library cyassl (http://www.yassl.com/). This is a secure wrapper for standard socket functions like read, write, send and recv (cyassl_read, cyassl_write, etc.). You have to feed it the certificates before you can connect to a secure server. It is not necessary to compile cyassl first, it is all one big project.
If you prefer you can create a library for cyassl and use it for instance with Mingw or on Linux or Mac. Many different platforms are supported. See also the remarks on compiling cyassl below.
Pitfalls
- Certificates expire. If you can ping the server but you cannot connect to it while its LED blinks at the normal unconnect rate of about 2 Hz, it may be that your certificates have expired. Create new certificates to solve this.
- Restore factory settings erase main application. If you boot the board with JP3 in place, the server will revert to its factory settings. This may/will also erase its main application, making it impossible to connect to the server afterwards. If this is the case the LED will blink fast (>2 Hz). The solution is to set the server's IP address using ISLRaw, then reboot the server without JP3, set again the server's IP address using ISLRaw, then use ISLElektor to upload the (new) firmware to the server (this takes about a minute). After setting once more the server's IP address with ISLRaw you can upload the certificates and finally connect again to the server.
- CYASSL is needed. To build a project for communicating with the server you need an SSL library. We have used the Open Source library CYASSL 2.8.0. Download it from www.yassl.com. Try to see if you can compile the library without errors for your platform.
- Once the library compiles successfully, add the following code fragment to the top of the file "settings.h" (in the folder "cyassl-2.8.0\cyassl\ctaocrypt\"):
- Replace line 3166 of the file cyassl-2.8.0\src\internal.c with this
- Replace line 2032 of the file cyassl-2.8.0\src\ssl.c with this
- Recompile the CYASSL library. If you now see errors or multiple definitions, your compiler project or makefile probably defines some symbols that you don't want. You or your makefile must not define OPENSSL_EXTRA. Compilation may produce some type cast warnings but no errors.
If you experience problems with cyassl refer to the manual (http://www.yassl.com/yaSSL/Docs-cyassl-manual-toc.html).
It may be useful to make cyassl verbose so it will output debug messages. To do so, build the library with the constant DEBUG_CYASSL defined _AND_ by calling CyaSSL_Debugging_ON() somewhere at the beginning of your program.
The attached archive "130499-cyassl-as-library.ZIP" contains a project showing how to use cyassl as a library in your own project.
The attached file "bpl.zip" contains the BPL and DLL files that are needed to run the precompiled tools. They are now also included in the file "ISLElektor050314.zip" below.
Discussion (11 comments)
Yoyod 10 years ago
Hi,
In order to use the E-Lock card, I've started to develop an API for Python 3.4.1
It is a very simple API, that can open & close a connexion with the ELock, set the relays state, set temperature config and get temperature value.
In order to get the connexion you will need 3 files (instead of 2 with ISLElektor.exe) :
The Libary implement two classes :
At the end of the source code, you will find some test of the two classes
14/04/2015 : Now the source code is also available in a GitHub repository : https://github.com/yoann-darche/PyELockAPI. Please fill free to update or enhance.
Enjoy it !
Yoann
ClemensValens 10 years ago
Yoyod 10 years ago
As I've encounter several issue while trying to configure the E Lock card, I've created this document, discribebing all steps (from generating keys to connect to the card).
I hope that will help you.
Yoyod 10 years ago
Hi all,
I've an issue, that seem easy to solve, but after many try, and read I can not find the solution. Maybe could you help me....
So I've 2 Elock cards, and I've followed the documentation to generate Keys and Certificates.
I've used the ISLRaw software (on Win7 x64, only one Inet active, no bluetouth). I've successfully set the IP adress, gateway, certficates and key.
When I try to connect to the device with ISLElektor I got the status 'Error' after few seconds.
I can ping the device.
After lot reading I've try to reset the firmware, I've successfully done it, with all expected step sate described.
But I can't connect in normal mode using ISLElektor (same status : Error).
I've decided to use second ELock, and test with the demo certificates from the Zip file from Elektor, I run into the same situation....
What am I missing ! Any Idea ?
Thanks,
Yoann
I've try on the
ed010 10 years ago
Yoyod 10 years ago
Yoyod 10 years ago
HaSch 10 years ago
DE170001 10 years ago
HaSch 10 years ago
ddartois 10 years ago
I run ISLraw and see the MAC address of my e-lock board. Clicking 'Set remote IP' has no effect. Any clue?
Regards.
Dominique.
ClemensValens 10 years ago
ddartois 10 years ago
ddartois 10 years ago
ClemensValens 10 years ago
HaSch 10 years ago
Hi,
I followed the guide 'network-configuration' to create new certificates and keys. 2.1 to 2.4 worked well but I stayed at 2.5 'Generating the Certificate'.
If I run the command:
openssl ca -config /etc/ssl/openssl.cnf -out ISLserver-cert.pem -infiles /etc/ssl/demoCA/ISLserver-req.pem
I always get the following error message:
HaSch 10 years ago
HaSch 10 years ago
HaSch 10 years ago
ClemensValens 10 years ago
ddartois 10 years ago
HaSch 10 years ago
ClemensValens 10 years ago
HaSch 10 years ago
ClemensValens 10 years ago
intelligentsoc 10 years ago
Hi to all of you.
The e-Lock-board is delivered with ready to use firmware. You only need to assign an IP address and to install certificates.
If you run into trouble, you can reset the firmware following the steps below:
¡¡¡ ATTENTION !!!
This procedure will reset the board and it could become unusable. Use it AT YOUR OWN RISK..
Before you begin, you will need:
NOTE: On the e-Lock board jumper JP3's pin 1 is marked with a little white dot near X2 oscillator's upper right corner - when you can read elektor chip in front of you and the RJ-45 connector is of the right side.
Once done, follow these steps:
First, we erase all software & IP config.
Hope this help you.
sclaes 10 years ago
Is this a windows only project?
Regards,
Stefaan Claes
ClemensValens 10 years ago
morris51 10 years ago
morris51 10 years ago
intelligentsoc 10 years ago
intelligentsoc 10 years ago
intelligentsoc 10 years ago
Hi.
I'll try to do my best to explain the e-Lock's start up process.
When you receive the board, it has the firmware loaded, so it is necessary only to setup an IP address and to load certificates in order to have it fully functional.
IMPORTANT!!!! Please, take into account that some firewalls / antivirus can disturb ISLRaw connection, so it's very important to have those disabled when connet e-Lock with ISLRaw.
When you connect e-Lock board for the first time, the red light is fixed to indicate it needs an IP and certificates.
1 - Run ISLRaw.exe WITH ADMINISTRATOR RIGHTS.
2 - Click 'Scan MAC' button. It would appear the MAC address of e-Lock boards connected.
3 - Select the MAC with IP 'not configured'
4 - Set the IP you want to assign e-Lock and click 'Set Remote IP' button. It must appear a new screen to load certificates
5 - Select admin certificate, key and CA certificate as correspond.
6 - Adjust the other settings. You can leave SNTP server and DNS Address by default. Pay attention to Gateway address. It must be the gateway of your network.
7 - Click 'Send' button.
8 - A window indicating succesfull config is shown.
At this point, e-Lock is configured with IP and certificate so it is ready to work as expected.
IT IS VERY IMPORTANT that ISLElektor has Internet connection since it needs to validate certificate's date. In order to avoid security risk, this validation is made against Internet Time Servers.
To TEST the e-Lock functionalities, ISLElektor application was included.
Once you enter your e-Lock IP address and click 'Connect' button FIRST time, it is necessary to load client certificate to validate connection against e-Lock. You can use the demo certificates included or generate your own ones as indicated in docs.
Once client certificate has benn validated, the blue 'Connected' string is shown.
Now, you can test e-Lock functionality.
Thank you.
dyer.p@btinternet.com 10 years ago
Please note I am using Windows 8.1.
I have managed to set the ip address on the E-Lock board. However this required the downloading of several Borland files.
Could you please provide a link to the files you used to compile the program.
I can now ping the board.
However when I try to connect using ISLElektor, after downloading several more files, it fails. In particular the new window to select the Client Certificate key does not appear. I have tried the program in XP compatibility mode but that doesn't help. I'd like to start by trying to get the correct version of the Borland files.
I'd be grateful for some help with this.
Regards
Peter
apple 10 years ago
intelligentsoc 10 years ago
apple 10 years ago
intelligentsoc 10 years ago
apple 10 years ago
ClemensValens 10 years ago
dyer.p@btinternet.com 10 years ago
ClemensValens 10 years ago
dyer.p@btinternet.com 10 years ago
intelligentsoc 10 years ago
dyer.p@btinternet.com 10 years ago
ClemensValens 10 years ago
dyer.p@btinternet.com 10 years ago
dyer.p@btinternet.com 10 years ago
Peter Mul 10 years ago
ClemensValens 10 years ago