Implementing Bluetooth Data Collection Into Scouting App

Hello everyone! For the past two years, my team has been using a scouting app that we made from scratch in 2021. On paper, the scouting app is quite simple (I’ll link the repo at the bottom).

Essentially, it works by using an Apache2 server to host a website. This website is then used to fill out information about a team during a match or record pit scouting info. Afterward, the info is moved via Connector Python to a mySql database. The current implementation requires a hardwired ethernet connection to the server laptop.

What we (I) want to do this year is implement Bluetooth into the app. Even though the current implementation works, it’s a big mess with wires and old computers dying left and right. I’m not entirely sure how to do this, but I’ve been looking into using the PyBlueZ library. If anyone knows how to, or has any tips on how to implement this, it would be greatly appreciated. Assuming this works, the plan is to buy android tablets to load up the website and submit the data via Bluetooth.

Link to GitHub repo

2 Likes

MIT has a very good documentation, An Introduction to Bluetooth Programming. Chapter 3 has Python examples on PyBlueZ library. Prior knowledge with socket programming will be helpful.

5 Likes

Bluetooth is legal correct? We possibly could implement it for this season as well, would be much better than cellular or wired connections.

2 Likes

bluetooth tips

be aware of your range constraints. even if you add an antenna dongle to the laptop, you will be limited by the tablets' range.

after doing a bluetooth powered project a while back, one takeaway that I got from it was to 100% implement some sort of local “cache” which will store outgoing data on the front end in the event that the wireless data transfer fails. since yours is a website, look into something like localForage (javascript lib) to store data when transmission fails.

app tips

look into Progressive Web Apps (PWA). they allow you to statically store web pages on a device, so you can limit communication to the data

AFAIK, websites do not support regular bluetooth sockets. you will likely have to use BLE, which has even less range.

MIT App Inventor is a good place to build a dead simple form app that can use regular bluetooth sockets. it unfortunately is a block-style app builder but ig that makes it easier to convert from web to app? note that it only makes APKs for android so no IOS.

1 Like

I KNOW HOW TO. ITS ME. IM THE EXPERT. I’ve been working on a solution for my own team 5199 for a while and was going down the exact same path by using Bluetooth. I’m currently more focused on the actual hosted site our team will be using. But I have a working system that is being hosted on a raspberry pi. I’m not sure how to do it on windows or Mac or really anything else than exactly how I did it myself. But feel free to respond if you want to know more.

Currently for my own rendition of a scouting form I’m looking into all sorts of features like where some people mention PWA, local and session storage, also some of my own such as live visual data analysis and the entire site being configurable through JSON. Everything is still in the early stages of being worked out for the site itself. But my hardware, the Bluetooth server, is functioning

Wow, I wasn’t necessarily expecting anyone to do the same thing. So a few questions, are you planning to use Bluetooth sockets or something similar? Also, how are you hosting off of Bluetooth? I currently have a web server, but to connect you need to be hardwired. Now that I think of, I might have a solution for the second question, but I’m still curious to what you plan on doing/have done.

Thank you!

Thank you for the response. I’ll definitely look into PWA’s. Other than that, the local cache idea makes sense.

I’m not sure what you mean by Bluetooth sockets. So I’ll just explain my solution. I’m using a raspberry Pi to host something called a Bluetooth PAN Network. Which is just another type of network adapter and works similar to a regular Ethernet/wifi network, just using Bluetooth.

I’m using Apache as a webserver on the pi to host my web form and like any other hosting. Connecting to the same network and entering the device ip opens the website. So I connect to Bluetooth, enter the device’s IP, and it pops up. Simple as that.

I did a lot of research into this specific solution as this really hasent been done before, or at least not that I found after a couple weeks of research. It’s a simple solution but if you aren’t familiar with the fields of networking adapters and raspberry pi OS it was a difficult task.

If you are also using a Raspberry Pi or Linux based system I have a step by step that I can share however if you use windows you can reference it, but I’m not sure if or how it would work

1 Like

Celt-X created a scouting app that uses Bluetooth for data transfer and we’ve been using it for a few years now. We actually did a presentation explaining how it’s setup. It uses a Bluetooth Personal Area Network running on a Windows 11 laptop

2 Likes

Hi! I know it’s been a while since you replied to my post. However, with the season in full swing, I was wondering if you could share the step-by-step guide? I have a pretty decent idea on how to implement it, as it seems the scouting app that you use is almost the same as mine.