Download the PHP package cosmicvibes/xtrem-scale without Composer
On this page you can find all versions of the php package cosmicvibes/xtrem-scale. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download cosmicvibes/xtrem-scale
More information about cosmicvibes/xtrem-scale
Files in cosmicvibes/xtrem-scale
Package xtrem-scale
Short Description Laravel package for communicating with Gram Xtreme F-06 scales over UDP.
License MIT
Homepage https://github.com/cosmicvibes/xtrem-scale
Informations about the package xtrem-scale
Xtrem Scale Package
Laravel package for connecting to Gram Xtreme F-06 scales over network.
Installation
Add the package to your Laravel project:
Or add it as a local package by adding this to your main composer.json:
Then run:
Configuration
Publish the configuration file:
Add your scale IP address to .env:
Usage
Using the Facade
Direct instantiation
Quick read
API Route Example
Response Format
The getWeight() method returns an array with:
weight mirrors whichever of gross/net the scale itself is displaying, at the
scale's own resolution.
When the scale cannot report a weight it streams a status frame instead, and
success is false with status_code set and error describing it:
status_code |
Meaning |
|---|---|
| 1 | Flash memory error |
| 2 | ADC failure |
| 3 | Load cell signal out of range |
| 4 / 5 | Load cell signal too high / too low |
| 7 | Overload — weight exceeds the scale maximum |
| 8 | Scale is not showing a weight (display shows dashes) |
Status code 8 is normal: it is what the scale reports when it is idle with nothing on the platform.
Reading continuously (multiple consumers)
A scale can only usefully be read by one process at a time:
- Its UDP receive port can only be usefully bound once per host — two readers on the same machine will steal each other's datagrams.
- Its streaming state is global, so a client that stops the stream blinds every other reader, on every machine.
getWeight() is therefore only appropriate for occasional one-off reads. To serve
many consumers, have a single process own the stream and publish the readings for
everything else to consume:
Neither getWeight() nor closeStream() sends the stop command, precisely so that
one consumer can never switch off another's stream.
Requirements
- PHP 8.2 or higher
- Laravel 10.x, 11.x, 12.x, or 13.x
- UDP sockets enabled (sockets extension)
Network Configuration
The Gram Xtreme F-06 scale uses UDP communication:
- Send Port: 4445 (commands sent to scale)
- Receive Port: 5556 (data received from scale)
Ensure your firewall allows UDP traffic on these ports.