otghcloud/laravel-edgelink

Laravel package for Advantech/Edgelink ADAM RTU REST API integration.

Maintainers

Package info

git.otgh.cloud/open-source/laravel/edgelink.git

Homepage

pkg:composer/otghcloud/laravel-edgelink

Statistics

Installs: 3

Dependents: 0

Suggesters: 0

v1.0.1 2026-05-29 12:22 UTC

This package is auto-updated.

Last update: 2026-05-29 12:23:25 UTC


README

pipeline status Latest Release

Laravel Edgelink Client

A full featured Laravel client for Advantech's Edgelink compatible devices (i.e ADAM-3600 RTU).

Features

  • auth(): login/logout
  • tags(): tags list, single-tag lookup, tag value updates
  • system(): control/version/update info/web settings/device info
  • io(): AI/AO/DI/DO slot/channel reads and writes
  • dataLogger(): daq query wrapper
  • firmware(): verify/upload/update/recovery wrappers
  • logs(): log_create/log_message wrappers
  • network(): lan/wlan/cellular/gps/remoteit wrappers

Installation

You can install the package via composer:

composer require otghcloud/laravel-edgelink

Configuration

If you wish to specify a default connection, you can publish the config file by running the below:

php artisan vendor:publish --tag="laravel-edgelink-config"

This creates config/edgelink.php, allowing you to define default credentials.

These can of course be changed at runtime (see further below).

return [
    'base_url' => env('EDGELINK_BASE_URL'),
    'password' => env('EDGELINK_PASSWORD'),
    'referer' => env('EDGELINK_REFERER'),
    'verify_tls' => env('EDGELINK_VERIFY_TLS', false),
    'timeout_seconds' => env('EDGELINK_TIMEOUT_SECONDS', 10),
];

Usage

use OTGH\LaravelEdgelink\LaravelEdgelinkClient;

$client = LaravelEdgelinkClient::fromConfig();
$client->login();
$tags = $client->getTags();
$oneTag = $client->getTag('Slot1:DI_5_SD_LockStatus');

$version = $client->system()->version();
$aiChannel = $client->io()->ai(slot: 0, channel: 2);

Runtime Connections (No Config Required)

You can create clients directly with runtime connection details when you need to talk to many RTUs dynamically.

use OTGH\LaravelEdgelink\LaravelEdgelinkClient;

$client = LaravelEdgelinkClient::make(
	baseUrl: 'https://10.5.1.60',
	password: 'rtu-password',
	referer: 'https://10.5.1.60',
	verifyTls: false,
	timeoutSeconds: 10,
);

$client->login();
$tags = $client->getTags();

You can also pass a runtime array into fromConfig().

use OTGH\LaravelEdgelink\LaravelEdgelinkClient;

$client = LaravelEdgelinkClient::fromConfig([
	'base_url' => 'https://10.5.1.60',
	'password' => 'rtu-password',
	'referer' => 'https://10.5.1.60',
	'verify_tls' => false,
	'timeout_seconds' => 10,
]);

Example with multiple RTUs in one job/request:

use OTGH\LaravelEdgelink\LaravelEdgelinkClient;

$rtus = [
	['host' => '10.5.1.60', 'password' => 'pass-a'],
	['host' => '10.5.1.61', 'password' => 'pass-b'],
];

foreach ($rtus as $rtu) {
	$baseUrl = 'https://'.$rtu['host'];

	$client = LaravelEdgelinkClient::make(
		baseUrl: $baseUrl,
		password: $rtu['password'],
		referer: $baseUrl,
		verifyTls: false,
		timeoutSeconds: 10,
	);

	$tag = $client->getTag('Slot1:DI_5_SD_LockStatus');
	// Handle each RTU result here.
}

License

The MIT License (MIT). Please see LICENSE.md for more information.