Skip to content

Conversation

@itzandroidtab
Copy link
Contributor

@itzandroidtab itzandroidtab commented Jul 20, 2025

This PR adds support for highlighting/locating of parts using a external device. I tried keeping the API as simple as possible to make sure it is doable on a microcontroller. The API works as follows:

API External Device

  • User creates Binner Bin API key (User can have multiple Bin API keys).
image
  • User copies API key to external device (Note the Bin location in the right most cell next to the delete button).
image image
  • When no BinNumber2 is available the part data it will show a empty string. In that case the whole bin should light up on the external device
image

API Binner Side

  • User goes to Inventory and presses Locate
image
  • A popup shows with the Color (in text and in the footer) and the part that is being highlighted.
image
  • In the background Binner will update a Dictonary with the new location to highlight. When the external device polls the API endpoint it will now add this location to the response.

  • While this popup is shown the Web UI will keep sending keep alives (every 2.5 seconds) to the endpoint to make sure the highlight stays active.

  • To cleanup the any highlights that are active there is a background process that checks every 5 seconds if there is any highlights that need to be removed (15 second timeout before removing the highlight).

Notes

  • Binner shows the same color when multiple users try to highlight the same part
  • Binner shows the same color when multiple parts are in the same bin
  • As long as one user keeps highlighting a part it will keep using the same color
  • Chooses randomly between all the JS named colors
  • Only reports locations to highlight for that specific bin

@itzandroidtab
Copy link
Contributor Author

itzandroidtab commented Jul 20, 2025

I made a small demo using some ws2801 and a lpc1788 dev board. In the video you can see the lights turn on when opening the "locate" popup. And you can see after closing the popup the light stays on for 15 more seconds before turning off. (each light is assigned a bin number 0 -> first led, 1 -> second led, etc)

Most of the colors appear oversaturated because there's no diffuser.

api_example.mp4

The LPC1788 was polling the API once every second in the video

@itzandroidtab itzandroidtab changed the base branch from releases/v2.6.18 to master July 26, 2025 21:49
@itzandroidtab
Copy link
Contributor Author

I now made it so if you press "close" it will stop it straight away

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant