Giter VIP home page Giter VIP logo

d3vice-controlpoint-xbee's Introduction

d3vice-controlpoint-xbee

Arduino Fio / XBee based D3VICE control point for Airsoft games

Feedback

If you have used and enjoy this code base, I'd love to hear from you!

Say Thanks!

Development setup process

  • Download, Install Atom editor
  • Download, Install Platformio Atom package
  • Restart atom. Open Atom & PlatformIO then import this repo.

??? @TODO once I figure out the process after this

  • Install contributed libraries Sketch > Include Libraries > Manage Libraries
    • Adafruit NeoPixel library
    • XBee-Arduino library
  • Add your user account to tty and dialout groups (May or may not be required for your OS)
    • sudo usermod -aG tty,dialout <YOUR_USERNAME_HERE>

Enclosure Ideas

XBee

Setup

To connect to the XBee, a SparkFun FTDI Basic Breakout 3.3v is used along with an Adafruit XBee Adapter kit v1.1. As my Adafruit XBee adapter kit v1.1 is discontinued, the replacment seems to be Adafruit's USB XBee Adapter which I haven't tested but should do the trick. A separate FTDI chip isn't necessary with that new model.

XCTU is the program for configuring XBee modules. It is cross-platform.

57600 baudrate

Set the controlpoint as an ZB Router API NOT a ZB Endpoint API! Endpoint will work, but has complications with sleep mode.

XCTU Troubleshootinghttps://www.youtube.com/watch?v=ChCHfJoo9CQ

Make sure if using it on linux, you add yourself to the dialout group. Example: sudo usermod -a -G dialout chris

Make sure Arduino IDE is closed when working with XCTU. Radio discovery can be finnicky, but it works when it works.

XCTU's download links on Digi's website are usually broken. Find the filename from the download page, then manually browse their ftp server for the correct version of XCTU.

If you can't get XCTU to communicate with your XBee, the rule of thumb is keep trying. It doesn't always work the first or second time. Try the different connection methods as well, from discovery to manually entering XBee serial/USB configuration.

Power

The XBee is very sensitive when it comes to power. It needs as close to 3.3V as possible. When using USB, the Fio gives it a clean 3.285V. 3.296 was acheived using the buck converter regulator and that seemed to do the trick. If you are attempting to remotely program the XBee using X-CTU, and the read process seems slow, it may be that the XBee is crashing when it tries to pull power. Check voltages and try again.

IDs

PAN ID

0x73706F6B616E6561 (ASCII spokanea)

switzerland-robust

SH 0013A200 SL 40B51A26

borders-portals

SH 0013A200 SL 40B774EC

Special Thanks

The following people have helped this project in some way, and deserve a mention. Thank you all for helping this project become a reality!

Todo list

  • Fix phase 3 issue where ttw is ???
  • Implement XBee
  • Implement debugging via XBee wireless link
  • Fix button debounce issue
  • Fix endless beep on phase >=1
  • Add button hold logic
  • Implement ButtonManager
  • Try LoRa radio Moteino looks nice.

Parts list

d3vice-controlpoint-xbee's People

Contributors

insanity54 avatar

Watchers

 avatar  avatar

d3vice-controlpoint-xbee's Issues

Russell Seal of Approval

D3vice hardware needs Russell's seal of approval. (seek negative feedback, fix issue, repeat until no negative feedback remains)

Compatibility with gateway

The controlpoint should be able to do the following--

  • Announce itself to the network
  • Resume gameplay gracefully after unexpected reboot
  • Sync state with feathers server

Power supply is not secure

The power supply flops around given slack in the power wiring. The main board does not stay put with Velcro. A better solution for mounting the modules to the inside of the box is preferred.

Brandon Seal of Approval

D3vice hardware needs Brandon seal of approval. (seek negative feedback, fix issue, repeat until no negative feedback remains)

LightStrip::show() should be more user friendly

I don't know a good solution yet, but LightStrip::show() is not very good at displaying values above the maximum number of neopixels. Perhaps when displaying values above the max number of neopixels, it could switch to a binary display?

As it is right now with 16 neopixels, once the number to be displayed goes beyond 15, the neopixel display just goes blank, until the user increments the config to 255. Once 255 is reached, one more increment wraps around to 0, at which point the first neopixel is displayed. Binary seems nice for developers, but then again it's not nice to stare into neopixels and calculate what the displayed value actually is. Also most end users probably can't read binary.

Best UX is through the GUI of course, but there has to be a better way to communicate to the user what value they have chosen. Maybe a generic progress bar that means max is 255? That seems error prone. Binary still seems best.

Parser wanted

The controlpoint receives HEX encoded data generated by the gateway--

            xbee.remoteTransmit({
                destinationId: device.did,
                broadcast: false,
                data: `DCXST
                       CT${device.controllingTeam.toString(16)}
                       RP${device.redProgress.toString(16)}
                       BP${device.bluProgress.toString(16)}` // Tell DCX to act GAME 0
            })

This is nasty code that currently "parses" the received data

      if (
        rx.getData(0) == 'D' &&
        rx.getData(1) == 'C' &&
        rx.getData(2) == 'X' &&
        rx.getData(3) == 'S' &&
        rx.getData(4) == 'T' 
      )
      {
        // we're getting a state update (ST)
        
        if (rx.getData(5) == 'C' &&
            rx.getData(6) == 'T'
        )
        {
          // Controlling Team
          if (rx.getData(7) < 5) {
            controllingTeam = rx.getData(7);
          }
        }

        if (rx.getData(8) == 'R' &&
            rx.getData(9) == 'P'
        )
        {
          if (rx.getData(10) < 101) {
            redProgress = rx.getData(10);
          }
        }

        if (rx.getData(11) == 'B' &&
            rx.getData(12) == 'P'
        )
        {
          if (rx.getData(13) < 101) {
            bluProgress = rx.getData(11);
          }
        }
      }

You can see it is not flexible. For example, BP must always come after RP.

This is ideal code, but I'm unsure of how to implement a parser class.

    DCXParser dcxParser = DCXParser(rx);

      // interpret the state updates
     if (dcxParser.getDataType() == STATE_UPDATE) {
       controllingTeam = dcxParser.getData(CONTROLLING_TEAM);
       redProgress = dcxParser.getData(RED_PROGRESS);
       bluProgress = dcxParser.getData(BLU_PROGRESS);
     }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.