-
You Reply: 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 allpinMode(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 allU8 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. -
You Reply: 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 allpinMode(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 allU8 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. -
You Reply: 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.
-
You Reply: 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.
-
You Reply: 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.
-
You Reply: 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.
-
You Reply: 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.
-
You Reply: 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.