This week I moved onto the challenge of determining which solution would make the ideal “maître d'” for the system, as in, which type of device would provide both the best central control function and the best user satisfaction.
I had three BLE-enabled candidates to consider, namely an Android tablet (in my case I'm testing on an Amazon Fire 7" tablet), a Cypress CY5677 USB dongle and a PSoC 6 BLE Pioneer board with E-Ink Display Shield, which I had initially suggested would act as the central device in blog #1.
So I needed some sort of evaluation tool to determine the best outcome for the project. The theory is fairly simple, in that you want your customers to be satisfied with what the product does and with how much they paid for it.
It was time to evaluate the customer requirements, from the maître d's (or owner/manager’s) perspective against the technical specifications required to deliver these and then consider the strengths and weaknesses of the design resource to actually develop something that works well, without breaking the budget and exceeding the project timeline (i.e. make a judgement on risk of failure).
Perceived Customer Requirements
The list of features required for a good device for my application would be something like:
- Able to connect with multiple peripheral devices
- Easy and fast to connect and disconnect multiple peripheral devices
- Easy and fast to assign and amend peripheral device roles, e.g. waiter, kitchen, table etc.
- General speed of use (i.e. firmware on the device must be quick to use as cannot distract from day-to-day activities)
- Does not get in the way (i.e. the device has to be placed somewhere as working spaces are cluttered)
- Remains powered when required (i.e. not having to keep checking battery level)
- Reliable and dependable (i.e. do not want it to malfunction or perform badly)
- Can report problems (i.e. if something stops working you want to know)
- Have an option to track data (i.e. want the possibility to evaluate business process performance)
- Must be affordable (i.e. at the lowest cost possible)
Device Evaluation against these Requirements
Now that I had a good list of requirements, I could now attempt to work out what technical options I have available to deliver these. The purpose of this exercise is to then determine if any of the shortlisted candidates are not suitable to meet the requirements and to see if there is any clear winner. In most cases, this somewhat subjective qualitative process seldom provides a clear winner and thus is really just suitable for helping you to narrow down your shortlist.
- Able to connect with multiple peripheral devices
- All three candidate devices will be suitable.
- The Bluetooth Low Energy technology used in the devices (i.e. 4.1, 4.2 & 5.0 standards) will have a slightly different theoretical maximum number.
- The Bluetooth stack provided by the manufacture will have a theoretical limit and will be linked to the memory resources of the device.
- All three candidate devices will be suitable.
- Easy and fast to connect and disconnect multiple peripheral devices
- Easy and fast to assign and amend peripheral device roles
- General speed of use
- Android Tablet
- This will deliver, assuming it has a good touch screen and the user’s fingers are clean for touchscreens
- A larger Android table would possibly be better for readability
- Visibility will be fine as unlikely for central device to be used outdoors
- General speed and performance good (depends on model)
- USB Dongle
- On its own it does not deliver
- Plug into a desktop computer or laptop and then you could provide a good user interface as has larger screen size than tablets
- General speed and performance is good when used with PC/Laptop
- PSoC 6 BLE Pioneer Kit with eInk Display Shield
- Requires buttons for user interface
- Screen very small so limited on what you can display
- Screen does not update as fast as say TFT, OLED, or LCD options
- General speed and performance not as good as other two
- Screen offers very good daytime readability but not at night as no backlight provided
- Android Tablet
- Does not get in the way
- Android Tablet
- A large Android Tablet could get in the way as required to be on the premises to stay connected with peripherals
- A small Android Tablet should be fine
- USB Dongle
- If plugged into an existing PC or Laptop then it would not get in the way
- PSoC 6 BLE Pioneer Kit with eInk Display Shield
- It could be mounted on a wall to avoid getting in the way
- Android Tablet
- Remains powered on when in use
- Android Tablet
- Would require to be mains powered but tablet has a battery which offers a good backup option in case of power failure
- USB Dongle
- Requires external power source
- Does not have battery backup power option although you could manually swap in a USB battery pack.
- PSoC 6 BLE Pioneer Kit with eInk Display Shield
- Requires external power source
- Has a battery backup power option
- Android Tablet
- Reliable and dependable
- Android Tablet
- If user’s own tablet then little control over performance
- Android development environment allows for good performance but if other apps also running then may run into problems
- If the user is walking about with the Android Tablet there may be times when BLE transmissions are missed due to poor reception if there are black spots, for example.
- USB Dongle
- Have total control over choice of the Dongle itself and the embedded firmware
- Requires user’s own PC or Laptop so have little control over its performance
- PSoC 6 BLE Pioneer Kit with eInk Display Shield
- Have total control over evaluation and testing of PSoC 6 BLE Pioneer Kit and the embedded firmware
- Android Tablet
- Can report problems
- Android Tablet
- Most Android Tablets offer other connectivity options such as WiFi so remote notification possible
- Many Android tablets do not provide multi-role functionality
- USB Dongle
- Requires user’s own PC or Laptop to have connectivity and so remote notification possible
- Could provide multi-role functionality to allow user to connect their phone directly to dongle
- PSoC 6 BLE Pioneer Kit with eInk Display Shield
- No remote notification is possible other than through Bluetooth Low Energy technology
- Could provide multi-role functionality to allow user to connect their phone directly to device
- Android Tablet
- Have an option to track data
- Android Tablet
- Generally has good data storage capability with use of SD card
- Data can be sent to the cloud if connected via WiFi
- USB Dongle
- Requires use of owner PC or Laptop for storage and for connectivity to send data remotely
- Very limited storage options on the dongle itself and no additional hardware can be added
- PSoC 6 BLE Pioneer Kit with eInk Display Shield
- Only local storage options available
- Requires additional hardware to provide more local storage or other connectivity options
- Android Tablet
- Must be affordable
- Android Tablet
- Prices range considerably from $50 to well over $400
- If the end user has a spare tablet then there this is a zero cost solution
- USB Dongle
- The Cypress option is just $20
- PSoC 6 BLE Pioneer Kit with eInk Display Shield
- With enclosure and battery pack, would be looking at approximately $100
- Android Tablet
So, my conclusion following this exercise, is that the PSoC 6 BLE Pioneer Kit with eInk Display Shield can be ruled out (it will just be used as the table device) and that there is no obvious clear winner between an Android tablet and a USB dongle. It will probably come down to individual user preference.
Now that I had two viable options, it was time to start developing the management application for the system. I then decided upon a “learn by doing” approach to test my own abilities and to determine least risk option to getting a complete prototype system up and running within the timescales. I decided worked on the two solutions in parallel.
Here is a brief overview of my Work-In-Progress (WIP).
Android Tablet App
The ideal software to develop this firmware would be with Android Studio as you would then be able to create an app to operate as a background service and it provides complete connectivity functionality such as bonding options and authentication.
Unfortunately, my old PC is not up to the job to handle Android Studio’s runtime requirements. So, in this case I am resorting to using MIT App Inventor 2 (AI2) as this has the required extensions to provide the BLE core functionality I require for a proof of concept application. For more information about using the BLE extension in applications it is worth reading through App Inventor's IOT section. They also have a nice setup guide to get you started.
But with AI2 there are limitations. Unfortunately, with AI2 you cannot develop apps to run as a background service and you cannot set up bonding or additional authentication modes. But for now, those specific features will have to wait as they do not alter the ability to demonstrate the functionality I require for the proof of concept mobile app.
The basic logic flow for the app will consist of: an initial registering screen (as shown in picture), a sign-in screen (to prevent unauthorised user access) and then a management dashboard where you can scan and connect with BLE peripheral devices and then assign these devices roles, e.g. a tables or a waiter, etc.
USB Dongle and Desktop Application
I rather liked this option, primarily from a curiosity perspective as it provides me with a new option for the Cypress CY5677 USB dongle, which comes as standard with the PSoC 6 BLE Pioneer Kit. If you read my Roadtest Review, I felt that its usage is only occasional as a BLE test device. So what better way to reuse by giving it a new role and a new life.
However, this is easier said than done within the timescales, so I will see how I get on. Still, I wanted to start exploring this option a little more to investigate feasibility, especially as I will get more connectivity options with the dongle such as bonding and authentication. I found some useful links on this topic on both Cypress (PROJECT #017: BLE PRIVACY) and TI (GAP Bond Manager and LE Secure Connections) websites.
For the desktop application, I decided to try out ElectronJS as the website said some encouraging words: “If you can build a website, you can build a desktop app. Electron is a framework for creating native applications with web technologies like JavaScript, HTML, and CSS. It takes care of the hard parts so you can focus on the core of your application.” Now that sounds good to me.
In fact, trying out ElectronJS for the first time proved to be a great decision on my part. It did not take too long to create a basic landing page, using the bootstrap template and to get my application to detect the USB dongle’s serial port. To achieve this, I also incorporated the Vuejs JavaScript framework, which I also had never used before.
The really nice thing about ElectronJS is that you can use NodeJS components which you can download using the Node Package Manager or NPM. The key one to use is called Node SerialPort. On this page it provides all the necessary installation instructions, including what you need to do when using ElectronJS - "If you require serialport as a dependency for an Electron project, you must compile it for the version of Electron your project's using."
// This file is required by the index.html file and will // be executed in the renderer process for that window. // All of the Node.js APIs are available in this process. const serialport = require('serialport'); var vue2 = new Vue({ data: () => ({ ports: [] }), mounted() { this.getPorts(); }, methods: { getPorts() { serialport.list((err, pts) => { if (err) console.log('error', err.message); else console.log('error', ''); if (pts.length === 0) console.log('error', 'No ports discovered'); this.ports = pts; console.log('ports', pts); }); } } }); var app2 = vue2.$mount('#portList');
Here is a screenshot of my landing page for the application, showing that it had recognised that 2 devices were connected to the desktop serial ports.
So, in my opinion, this ability to create desktop apps which can also interface with the serial port, has just supercharged that Cypress USB BLE dongle into becoming an extremely versatile hackable device. Now, that is rather nice!
Summarising
In summary, it looks like I will concentrate on developing the mobile app as I am most familiar with this development environment, but will continue to learn the ropes regarding Electron and Vuejs using my application as a real world project to work from, as I believe this offers great potential.
Top Comments