Easy IoT General

Souliss - Xboard and Android

userHead Jose 2013-08-08 15:26:41 18800 Views19 Replies
Hello,

I saw some issues regarding configuring the environment for Souliss with Xboard relay:

on the configuration site:
https://code.google.com/p/souliss/wiki/ ... figuration

[quote]
should i create a file named"conf/QuickCfg.h"
[/quote]

In the Souliss configuration file you will just need to select :
0x03 Arduino Ethernet (W5100)

this means i have to edit the library? or just add this line on my sketch?
[quote]
How can i change the IP of my device, these lines are a little confusing so i am not sure how to change this:

#define network_address_1 0x0011
#define network_address_2 0x0012
#define network_my_subnet 0xFF00
#define network_my_supern 0x0000
[quote]

Thanks

2013-08-13 20:02:55 That's great! I should cover more the first setup phase to makes it easier.

In the Arduino IDE, if you go under Examples->hardware->DFRobot you will found the example ssXBoardRelay_ex01_Lights that drive both the relays.

Yes of course, basically each Souliss node has a memory area with inputs and outputs. The logics are attached to those, and any input is processed. So the board doesn't care from where the inputs are coming, just it process the inputs and wait for new one.
Inputs can came in parallel from the Android application, from other nodes or from a the board it self.

You can read here for more details:
http://code.google.com/p/souliss/wiki/DataStructure

So, lets start from inputs from local switches. Read the example Souliss_ex02_FiatLux_eth1.ino that is same as the XBoardRelay one out of pin mapping, you will found these more lines of code:
Code: Select all
pinMode(2, INPUT);					// Hardware pulldown required
pinMode(3, INPUT);					// Hardware pulldown required	

...

// Use Pin2 as ON/OFF command
Souliss_DigIn(2, Souliss_T1n_ToogleCmd, memory_map, LIGHT1_NODE1);	

// Use Pin3 as ON/OFF command
Souliss_DigIn(3, Souliss_T1n_ToogleCmd, memory_map, LIGHT2_NODE1);		
These gives to some input pins the toogle command, that will drive a relay with a local switch on the board. Of course, you will still be able to control them over Android.

If then you would have that a different board has local switches that control the relays on the other one, then refer to Souliss_ex02_FiatLux_eth2.ino that use the command
Code: Select all
U8 Souliss_RemoteInput(U16 addr, U8 slot, U8 command);
to force remotely a command to another board.

This is just the starting point, you can do more with analog and more complicated cases. Just start step by step.

Let me know and thanks for your experiments.

Regards,
Dario.
userHeadPic veseo
2013-08-13 20:02:55 That's great! I should cover more the first setup phase to makes it easier.

In the Arduino IDE, if you go under Examples->hardware->DFRobot you will found the example ssXBoardRelay_ex01_Lights that drive both the relays.

Yes of course, basically each Souliss node has a memory area with inputs and outputs. The logics are attached to those, and any input is processed. So the board doesn't care from where the inputs are coming, just it process the inputs and wait for new one.
Inputs can came in parallel from the Android application, from other nodes or from a the board it self.

You can read here for more details:
http://code.google.com/p/souliss/wiki/DataStructure

So, lets start from inputs from local switches. Read the example Souliss_ex02_FiatLux_eth1.ino that is same as the XBoardRelay one out of pin mapping, you will found these more lines of code:
Code: Select all
pinMode(2, INPUT);					// Hardware pulldown required
pinMode(3, INPUT);					// Hardware pulldown required	

...

// Use Pin2 as ON/OFF command
Souliss_DigIn(2, Souliss_T1n_ToogleCmd, memory_map, LIGHT1_NODE1);	

// Use Pin3 as ON/OFF command
Souliss_DigIn(3, Souliss_T1n_ToogleCmd, memory_map, LIGHT2_NODE1);		
These gives to some input pins the toogle command, that will drive a relay with a local switch on the board. Of course, you will still be able to control them over Android.

If then you would have that a different board has local switches that control the relays on the other one, then refer to Souliss_ex02_FiatLux_eth2.ino that use the command
Code: Select all
U8 Souliss_RemoteInput(U16 addr, U8 slot, U8 command);
to force remotely a command to another board.

This is just the starting point, you can do more with analog and more complicated cases. Just start step by step.

Let me know and thanks for your experiments.

Regards,
Dario.
userHeadPic veseo
2013-08-13 19:41:42 That was it, thanks much.

However we are just getting started here  ;D

Only one of the Relays(D7) shows up on Souliss apk, however both are initialized on the sketch. What am I missing, and how can I add the relay, and other sensors.

Do you have some pointers on how to get a node to read sensors, and interact with other nodes depending on sensor read without direct user interaction? This method still allows user to manually override and trigger relays independently of sensors status?

Thanks again!
userHeadPic Jose
2013-08-13 19:41:42 That was it, thanks much.

However we are just getting started here  ;D

Only one of the Relays(D7) shows up on Souliss apk, however both are initialized on the sketch. What am I missing, and how can I add the relay, and other sensors.

Do you have some pointers on how to get a node to read sensors, and interact with other nodes depending on sensor read without direct user interaction? This method still allows user to manually override and trigger relays independently of sensors status?

Thanks again!
userHeadPic Jose
2013-08-13 15:35:24 Is the node address, so we are most probably in the bug of the SoulissApp. Navigate into Settings -> Network Options and scroll down into the "Device ID" area.

Here you will found two options called "User Index" and "Node Index" and their relevant ranges as 1-100, 1-254. These two information are build as a two byte index and are swapped (this bug will be solved in next release) so also their limits are too.

Please try to set both at a value lower than 100, and try again. Send me also a screenshot about.

The Local IP Address is the one of the Souliss board, sometimes is still referred as "server" because in the first release the node was a JSON Server, this approach is no longer used, and is only an old text to be fixed.

Let me know if you can connect to the board.

Thanks,
Dario.
userHeadPic veseo
2013-08-13 15:35:24 Is the node address, so we are most probably in the bug of the SoulissApp. Navigate into Settings -> Network Options and scroll down into the "Device ID" area.

Here you will found two options called "User Index" and "Node Index" and their relevant ranges as 1-100, 1-254. These two information are build as a two byte index and are swapped (this bug will be solved in next release) so also their limits are too.

Please try to set both at a value lower than 100, and try again. Send me also a screenshot about.

The Local IP Address is the one of the Souliss board, sometimes is still referred as "server" because in the first release the node was a JSON Server, this approach is no longer used, and is only an old text to be fixed.

Let me know if you can connect to the board.

Thanks,
Dario.
userHeadPic veseo
2013-08-13 15:06:20 Hi Veseo,

I've tested it as well without any success.

Pinging from a PC works fine. Souliss apk cant connect/find the node and test UDP ping does not ping it as well.

The menu you choose to set the IP of the node, since it is a older version its hard to tell if it does the same thing. On the description says insert souliss bridge node's IP address when using home network. But i am not sure if that is the Node ip, or the router?

Just in case i pinged from PC my souliss apk device without any problem, so they are connected in the same network.

EDIT:
On main window,  it says Souliss server is being contacted, what server is this? is this the node?
userHeadPic Jose
2013-08-13 15:06:20 Hi Veseo,

I've tested it as well without any success.

Pinging from a PC works fine. Souliss apk cant connect/find the node and test UDP ping does not ping it as well.

The menu you choose to set the IP of the node, since it is a older version its hard to tell if it does the same thing. On the description says insert souliss bridge node's IP address when using home network. But i am not sure if that is the Node ip, or the router?

Just in case i pinged from PC my souliss apk device without any problem, so they are connected in the same network.

EDIT:
On main window,  it says Souliss server is being contacted, what server is this? is this the node?
userHeadPic Jose
2013-08-13 12:05:09 Hi,
My board  connected with the Ethernet. And my Android smart phone connect  the WiFi router.
after I  set the IP address of my board into the "Local address"  the application can not connect with my Xboard relay.
iS there anything wrong  with my address?

[quote]
// network addresses
#define network_address_1 0x00D5 // 0x00D5 is equal to 213 in decimal 
#define network_my_subnet 0xFF00
#define network_my_supern 0x0000[/quote]
userHeadPic Grey.CC
2013-08-13 12:05:09 Hi,
My board  connected with the Ethernet. And my Android smart phone connect  the WiFi router.
after I  set the IP address of my board into the "Local address"  the application can not connect with my Xboard relay.
iS there anything wrong  with my address?

[quote]
// network addresses
#define network_address_1 0x00D5 // 0x00D5 is equal to 213 in decimal 
#define network_my_subnet 0xFF00
#define network_my_supern 0x0000[/quote]
userHeadPic Grey.CC
2013-08-12 23:49:38 Hi,

lets proceed by steps.

I assume that your board has IP address 192.168.0.213 as Jose was reporting, more your board is now connected to the WiFi router that your are using to connect your PC and Android smartphone.

If so, you could try to ping your board from the PC and see if you get response. If yes, your are on the good way and you can proceed with Android.
You need to set the IP address of your board into the "Local address", once done, the application will connect and you can start the process to build the database.

This video show the process for an old version,
http://youtu.be/VK7Mra4EQTI

Please let me know if you can proceed with the setup.

Thanks,
Dario.
userHeadPic veseo
2013-08-12 23:49:38 Hi,

lets proceed by steps.

I assume that your board has IP address 192.168.0.213 as Jose was reporting, more your board is now connected to the WiFi router that your are using to connect your PC and Android smartphone.

If so, you could try to ping your board from the PC and see if you get response. If yes, your are on the good way and you can proceed with Android.
You need to set the IP address of your board into the "Local address", once done, the application will connect and you can start the process to build the database.

This video show the process for an old version,
http://youtu.be/VK7Mra4EQTI

Please let me know if you can proceed with the setup.

Thanks,
Dario.
userHeadPic veseo
2013-08-12 13:04:58 Hi veseo,
if the serial port debugging is available on souliss library
How can I check whether it is connected or not ?
And there is another question.
my android souliss says is not connected, and how to connect it?
there are three address on  my screenshot
I don't  know the difference.    the address of my phone is192.168.0.140
How do I set up?or where to find a guide to use the android aplication
userHeadPic Grey.CC
2013-08-12 13:04:58 Hi veseo,
if the serial port debugging is available on souliss library
How can I check whether it is connected or not ?
And there is another question.
my android souliss says is not connected, and how to connect it?
there are three address on  my screenshot
I don't  know the difference.    the address of my phone is192.168.0.140
How do I set up?or where to find a guide to use the android aplication
userHeadPic Grey.CC
2013-08-09 15:45:18 Hi Jose,

once loaded and installed the Souliss library into the Arduino IDE, you should find under the Example three a set of predefined example. The one to start is the "Souliss_ex01_HelloWorld_eth1" that gives you the basic connectivity with the Android application, and a led toogle.

So, from the Example three select Souliss->Souliss_ex01_HelloWorld_eth1, at the top of the example you will found some details and the configuration that you should perform before proceed.

[quote]
/**************************************************************************
Souliss - Hello World

Is simply handle one LED remotely via an Android (or any equivalent
direct interface) and via an hardwired pushbutton.

The state of the LED (ON / OFF) is updated either if the LED status
change by Android or hardwired pushbutton.

The Local Device has
- A LED on Pin 9
- A pushbutton on Pin 2, pulldown required

CONFIGURATION IS MANDATORY BEFORE COMPILING
Before compiling this code, is mandatory the configuration of the framework
this ensure the use of proper drivers based functionalities and requested
communication interface.

Configuration files are located on /conf folder, is suggested to use this
code on one of the boards listed below, the code can also compile on other
boards but may require modification on I/O definitions.

Run this code on one of the following boards:

Board Conf Code Board Model
                0x03                Arduino Ethernet (W5100)
0x04 Arduino with Ethernet Shield (W5100)
0x05 Arduino with ENC28J60 Ethernet Shield

******************** Configuration Parameters *********************

Configuration file Parameter
QuickCfg.h #define QC_ENABLE 0x01
QuickCfg.h #define QC_BOARDTYPE 0x03, 0x04, 0x05

Is required an additional IP configuration using the following parameters
QuickCfg.h const uint8_t DEFAULT_BASEIPADDRESS[] = {...}
QuickCfg.h const uint8_t DEFAULT_SUBMASK[]      = {...}
QuickCfg.h const uint8_t DEFAULT_GATEWAY[]      = {...}

***************************************************************************/
[/quote]

So, open your library directory and move to Souliss\conf (see the attachment) inside that you will found the configuration files. Generally only QuickCfg.h is needed, the other files are used for advanced users.

In the attachment number two you can see the QuickCfg.h file edited with Notepad++ (you can use the editor that you like, but Windows Notepad is not suggested) and inside this file you can perform the requested configuration.

There is no line to be added in your sketch, you modify the values as needed. As you can see from the example details, are suggested the following Ethernet boards:

[quote]
Board Conf Code Board Model
                0x03                Arduino Ethernet (W5100)
0x04 Arduino with Ethernet Shield (W5100)
0x05 Arduino with ENC28J60 Ethernet Shield

******************** Configuration Parameters *********************

Configuration file Parameter
QuickCfg.h #define QC_ENABLE 0x01
QuickCfg.h #define QC_BOARDTYPE 0x03, 0x04, 0x05

[/quote]

This selection defines the drivers and the other libraries to be loaded. This example is just for connectivity, so also using an XBoard you can select Arduino with Ethernet Shield. Of course, once you will move to examples for XBoard Relay, you should specify that type of board (is listed into the QuickCfg.h file) so that the proper code for handling the relays and the pin mapping are loaded.

In your case, just use the XBoardRelay code (is shown in the attached screenshot) and proceed compiling.

At this stage you should be ready to compile without errors.

On the IP address side, is a bit tricky because Souliss use a virtualization layer that let the board communicate seamlessly over every media (wired/wireless/Ethernet/WiFi) without any user effort. This layer is called vNet and has its own addresses, the network_address_1 referred in the example is the vNet address.

When you have also an IP address (in case of Ethernet) that address is the sum of the BASEIPADDRESS and the vNet address (for the last byte)

In your case if you want to have 192.168.3.213, your BASEIPADDRESS (to be configured in the QuickCfg.h file) is 192.168.3.0 and your vNet address (network_address1) is 213 (or 0x00D5). Of course, all your board will be on the same network, so the BASEIPADDRESS have to be configured only once.

In the example, when you want to exchange data with a board, you should only use the vNet address 0x00D5 and not the whole IP address, also because you should care if the board that you would to connect is Ethernet, wireless or whatever.

At this point you should be able to compile and ping you board at 192.168.3.213, if yes, your board is running Souliss properly.

Once here, we can move for the connection of the Android application. You only need to insert the IP address of the board inside the SoulissApp and you are ready. Note that the application has a small bug and may assign to the smartphone a wrong vNet address, in that case, you should change it manually.

Let me know if proceed.

Regards,
Dario.
userHeadPic veseo
2013-08-09 15:45:18 Hi Jose,

once loaded and installed the Souliss library into the Arduino IDE, you should find under the Example three a set of predefined example. The one to start is the "Souliss_ex01_HelloWorld_eth1" that gives you the basic connectivity with the Android application, and a led toogle.

So, from the Example three select Souliss->Souliss_ex01_HelloWorld_eth1, at the top of the example you will found some details and the configuration that you should perform before proceed.

[quote]
/**************************************************************************
Souliss - Hello World

Is simply handle one LED remotely via an Android (or any equivalent
direct interface) and via an hardwired pushbutton.

The state of the LED (ON / OFF) is updated either if the LED status
change by Android or hardwired pushbutton.

The Local Device has
- A LED on Pin 9
- A pushbutton on Pin 2, pulldown required

CONFIGURATION IS MANDATORY BEFORE COMPILING
Before compiling this code, is mandatory the configuration of the framework
this ensure the use of proper drivers based functionalities and requested
communication interface.

Configuration files are located on /conf folder, is suggested to use this
code on one of the boards listed below, the code can also compile on other
boards but may require modification on I/O definitions.

Run this code on one of the following boards:

Board Conf Code Board Model
                0x03                Arduino Ethernet (W5100)
0x04 Arduino with Ethernet Shield (W5100)
0x05 Arduino with ENC28J60 Ethernet Shield

******************** Configuration Parameters *********************

Configuration file Parameter
QuickCfg.h #define QC_ENABLE 0x01
QuickCfg.h #define QC_BOARDTYPE 0x03, 0x04, 0x05

Is required an additional IP configuration using the following parameters
QuickCfg.h const uint8_t DEFAULT_BASEIPADDRESS[] = {...}
QuickCfg.h const uint8_t DEFAULT_SUBMASK[]      = {...}
QuickCfg.h const uint8_t DEFAULT_GATEWAY[]      = {...}

***************************************************************************/
[/quote]

So, open your library directory and move to Souliss\conf (see the attachment) inside that you will found the configuration files. Generally only QuickCfg.h is needed, the other files are used for advanced users.

In the attachment number two you can see the QuickCfg.h file edited with Notepad++ (you can use the editor that you like, but Windows Notepad is not suggested) and inside this file you can perform the requested configuration.

There is no line to be added in your sketch, you modify the values as needed. As you can see from the example details, are suggested the following Ethernet boards:

[quote]
Board Conf Code Board Model
                0x03                Arduino Ethernet (W5100)
0x04 Arduino with Ethernet Shield (W5100)
0x05 Arduino with ENC28J60 Ethernet Shield

******************** Configuration Parameters *********************

Configuration file Parameter
QuickCfg.h #define QC_ENABLE 0x01
QuickCfg.h #define QC_BOARDTYPE 0x03, 0x04, 0x05

[/quote]

This selection defines the drivers and the other libraries to be loaded. This example is just for connectivity, so also using an XBoard you can select Arduino with Ethernet Shield. Of course, once you will move to examples for XBoard Relay, you should specify that type of board (is listed into the QuickCfg.h file) so that the proper code for handling the relays and the pin mapping are loaded.

In your case, just use the XBoardRelay code (is shown in the attached screenshot) and proceed compiling.

At this stage you should be ready to compile without errors.

On the IP address side, is a bit tricky because Souliss use a virtualization layer that let the board communicate seamlessly over every media (wired/wireless/Ethernet/WiFi) without any user effort. This layer is called vNet and has its own addresses, the network_address_1 referred in the example is the vNet address.

When you have also an IP address (in case of Ethernet) that address is the sum of the BASEIPADDRESS and the vNet address (for the last byte)

In your case if you want to have 192.168.3.213, your BASEIPADDRESS (to be configured in the QuickCfg.h file) is 192.168.3.0 and your vNet address (network_address1) is 213 (or 0x00D5). Of course, all your board will be on the same network, so the BASEIPADDRESS have to be configured only once.

In the example, when you want to exchange data with a board, you should only use the vNet address 0x00D5 and not the whole IP address, also because you should care if the board that you would to connect is Ethernet, wireless or whatever.

At this point you should be able to compile and ping you board at 192.168.3.213, if yes, your board is running Souliss properly.

Once here, we can move for the connection of the Android application. You only need to insert the IP address of the board inside the SoulissApp and you are ready. Note that the application has a small bug and may assign to the smartphone a wrong vNet address, in that case, you should change it manually.

Let me know if proceed.

Regards,
Dario.
userHeadPic veseo
2013-08-08 16:17:54 is the IP address something like:
192.168.network_address_1.network_address_2


If i want to set up my network to be something like 192.168.3.213

I just need to change the network_address_1 variable?
userHeadPic Jose
2013-08-08 16:17:54 is the IP address something like:
192.168.network_address_1.network_address_2


If i want to set up my network to be something like 192.168.3.213

I just need to change the network_address_1 variable?
userHeadPic Jose
2013-08-08 15:26:41 Hello,

I saw some issues regarding configuring the environment for Souliss with Xboard relay:

on the configuration site:
https://code.google.com/p/souliss/wiki/ ... figuration

[quote]
should i create a file  named"conf/QuickCfg.h"
[/quote]

In the Souliss configuration file you will just need to select :
        0x03                              Arduino Ethernet (W5100)

this means i have to edit the library? or just add this line on my sketch?
[quote]
How can i change the IP of my device, these lines are a little confusing so i am not sure how to change this:

#define network_address_1 0x0011
#define network_address_2 0x0012
#define network_my_subnet 0xFF00
#define network_my_supern 0x0000
[quote]

Thanks

userHeadPic Jose