Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
blocks:app-note:nexmosphere [2021-04-21 09:41]
mattias [Change settings on the controller or sensors]
blocks:app-note:nexmosphere [2023-12-20 13:21] (current)
mattias [Use Nexmosphere sensors and actuators with Blocks]
Line 1: Line 1:
-Work in Progress+======Use Nexmosphere sensors and actuators with Blocks======
  
-======Use Nexmosphere devices with Blocks====== 
  
-This is an application note that describes how to get started using Nexmosphere sensors and actuators with experiences managed by Blocks. +This is an application note that describes how to get started using Nexmosphere sensors and actuators with experiences managed by Blocks. 
 + 
 +:!: The method in this application note is useful if connecting a Nexmosphere controller with a 3.5mm serial connector using a serial network server such as Moxa N-Port. From Blocks version 6.1 it is possible to connect a Nexmosphere with built-in serial to usb controller directly to Pixilab Players USB port. Please consult the manual for more details about serial devices in blocks.  
  
 =====Hardware requirements====== =====Hardware requirements======
Line 9: Line 10:
 In the examples we use the following hardware: In the examples we use the following hardware:
  
-Nexmosphere [[https://nexmosphere.com]]  +  * [[https://nexmosphere.com|Nexmosphere]] XN-180 Experience controllerThis is the "hub" device, with a serial port connected using a 3,5mm jack. 
- +  XT-EF650 Gesture sensor. 
-XN-180 Experience controller (This is the hub and this version has a 3,5mm serial port) +  XR-DR1 RFID Pick up sensor. 
- +  XW-L9 X-WAVE animating led strip. 
-XT-EF650 Gesture sensor +  Moxa [[https://www.moxa.com/en/products/industrial-edge-connectivity/serial-device-servers/general-device-servers/nport-5100-series|NPort 5100 Series]] - 1 Port Serial Device to TCP/IP Server. 
- +  3.5mm to D-SUB cable that connects the XN-180 to the Moxa Nport.
-XR-DR1 RFID Pick up sensor +
- +
-XW-L9 X-WAVE animating led strip +
- +
- +
-Moxa +
- +
-[[https://www.moxa.com/en/products/industrial-edge-connectivity/serial-device-servers/general-device-servers/nport-5100-series|NPort 5100 Series]] - 1 Port Serial Device to TCP/IP Server +
- +
-3.5mm to dsub cable that connects the XN-180 to the Moxa Nport.+
  
  
Line 57: Line 48:
  
 Now that the device has been set up you can import {{ :blocks:app-note:nexmosphere:proximityblock.zip | this block}} as a starting point or just create one on your own from scratch.  Now that the device has been set up you can import {{ :blocks:app-note:nexmosphere:proximityblock.zip | this block}} as a starting point or just create one on your own from scratch. 
-My example has two elements that uses the value from the sensor. Down the bottom there is  a text binding that show the current value as text.  +My example has two elements that uses the value from the sensor. Down the bottom there is a text binding that show the current value as text.  
 {{:blocks:app-note:nexmosphere:proximity_block.jpg?1000|}} {{:blocks:app-note:nexmosphere:proximity_block.jpg?1000|}}
  
-I have also applied a scale behaviour to the logotype. The behaviour is bound direct to the sensors proximity property. To smooth out the animation a bit i changed the minimum transition rate to 0.3 seconds. To try this, just assign this block to a spot and hold your hand in front of the sensor. +I have also applied a scale behaviour to the logotype. The behaviour is bound direct to the sensor’s proximity property. To smooth out the animation a bit i changed the minimum transition rate to 0.3 seconds. To try this, just assign this block to a spot and hold your hand in front of the sensor. 
  
 {{:blocks:app-note:nexmosphere:scalebehaviour.jpg?1000|}} {{:blocks:app-note:nexmosphere:scalebehaviour.jpg?1000|}}
Line 86: Line 77:
 =====Run a task triggered by a gesture===== =====Run a task triggered by a gesture=====
  
-Perhaps one would want to use a gesture to trigger a task. Let's take a look at an example task.  +Perhaps one would want to use a gesture to trigger a task. Let us look at an example task.  
-We trigger the task when iface_2_touch recieves a value.  As trigger condition we look for the trigger to match "Sd=LEFT". If it does we just log some information. +We trigger the task when iface_2_touch receives a value.  As trigger condition we look for the trigger to match "Sd=LEFT". If it doeswe just log some information. 
  
 {{:blocks:app-note:nexmosphere:example_task.jpg?1000|}} {{:blocks:app-note:nexmosphere:example_task.jpg?1000|}}
Line 97: Line 88:
 =====Use Nexmosphere RFID pick up sensors===== =====Use Nexmosphere RFID pick up sensors=====
  
-In this example we have a RFID sensor connected to interface 3 of the controller. We trig a task from the change of tagIsPlaced property and in the task we log the tagIsPlaced and TagId.+In this example we have a RFID sensor connected to interface 3 of the controller. We trig a task from the change of tagIsPlaced property and in the taskwe log the tagIsPlaced and TagId.
 Here tag no 3 has been placed and removed again. Here tag no 3 has been placed and removed again.
  
 {{:blocks:app-note:nexmosphere:rfidtasktagisplaced.jpg?1000|}} {{:blocks:app-note:nexmosphere:rfidtasktagisplaced.jpg?1000|}}
  
-It is pretty usefull to use a trigger condition to make sure task will only run if the desired tag has been placed. +It is pretty useful to use a trigger condition to make sure task will only run if the desired tag has been placed. 
  
 This example will only run if tag with ID no 4 has been placed. This example will only run if tag with ID no 4 has been placed.
Line 113: Line 104:
 =====Nexmosphere X-WAVE led strip===== =====Nexmosphere X-WAVE led strip=====
  
-The X-WAVE led strips can be very useful for user feedback or perhaps light effects.+The X-WAVE led strips can be useful for user feedback or perhaps light effects.
  
 In this example a LED strip has been connected to interface no 4 of the Nexmosphere controller. In this example a LED strip has been connected to interface no 4 of the Nexmosphere controller.
-In blocks this strip shows up as unknown device. +In blocks this strip shows up as an unknown device. 
  
-If I want to control the LED all have to do is to send a string command as rawData to the controller like in this example:+If I want to control the LED all have to do is to send a string command as rawData to the controller like in this example:
  
 <code> "X004B[250105]" </code>  <code> "X004B[250105]" </code> 
-Where no 4 in X004B specify which interface we want to send the command to. +Where no 4 in X004B specify the interface that we want to send the command to. 
  
-From the X-WAVE [[https://nexmosphere.com/document/Manual%20-%20Controlling%20X-Wave%20LEDs.pdf|API manual]] i know this means "Set LED output (on interface 4) to 50% intensity with color 1 in 0,5s"+From the X-WAVE [[https://nexmosphere.com/document/Manual%20-%20Controlling%20X-Wave%20LEDs.pdf|API manual]] i know this means "Set LED output (on interface 4) to 50% intensity with color 1 in 0,5s".
  
  
-And this little example will briefly change color whenever a RFID tag has been placed perhaps to provide some user feedback.+And this little example will briefly change colour whenever a RFID tag has been placed perhaps to provide some user feedback.
 {{:blocks:app-note:nexmosphere:led_control.jpg?1000|}} {{:blocks:app-note:nexmosphere:led_control.jpg?1000|}}
  
-Some sensor may have settings that is not persistent between reboots of the Nexmosphere controller. In those cases you may want send those settings from a task to the sensor in question and trig that task everytime the controllers connected property becomes true. +Some sensors may have settings that is not persistent between reboots of the Nexmosphere controller. In those casesyou may want to send those settings from a task to the sensor in question and trig that task every time the controllers connected property becomes true. 
  
  
-=====Change settings on the controller or sensors=====+=====Change settings on the controller or a sensor=====
  
-Some sensors has settings that has to be set from Blocks. There are no persistence in the Nexmosphere controller so typicly all settings has to be set after reboot of the controller. One way of doing this is to run a task that does just that everytime the controllers connected property becomes true. +Some sensors have settings that must be set from Blocks. There is no persistence in the Nexmosphere controller so typically all settings must be set after reboot of the controller. One way of doing this is to run a task that does just that every time the controllers connected property becomes true. 
  
  {{:blocks:app-note:nexmosphere:sendsettings.jpg?1000|}}  {{:blocks:app-note:nexmosphere:sendsettings.jpg?1000|}}
Line 145: Line 136:
  
  
 +=====Program RFID tags to be used with Nexmosphere RFID sensors=====
 +
 +Nexmoshpere uses MIFARE Classic tags and can provide software available for Windows computers that can be used to program tags. This software can be obtained from their support once you got the hardware. 
 +
 +It is also possible to program tags using a mobile phone. I use an Sony phone with Android OS and NFC enabled. 
 +Using softare such as MIFARE Classic Tool as in my example it is possible to write any tag ID to your tags. 
 +
 +{{:blocks:app-note:nexmosphere:mifare_classic_tool.png?400|}}
 +
 +A valid tag ID has to be between 1-255, 01-FF in hex.
 +In the screenshot below where i  read a tag already programmed as tag ID 3, 03 in hex  is repeated in all 16 bytes in sector 1 block 0. 
 +
 +{{:blocks:app-note:nexmosphere:readnexmotag.png?400|}}
 +
 +If I want to program a new tag with no 255 I would set the application to write tag mode with the following settings and press the write tag button while holding the tag to the mobiles NFC sensor:
 +
 +{{:blocks:app-note:nexmosphere:writefftag.png?400|}}
 +
 +This should be the final result from reading the tag with ID 255.
  
 +{{:blocks:app-note:nexmosphere:resultfftag.png?400|}}