trim((string)$device_id ?: 'unknown'), 'value' => (float)$value, 'timestamp' => date('Y-m-d H:i:s'), ]; file_put_contents( $jsonFile, json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) ); // ---- ÀÀ´ä ºÐ±â ---- // ¸ðµ© / curl ¿ë if (php_sapi_name() === 'cli' || strpos($_SERVER['HTTP_USER_AGENT'] ?? '', 'curl') !== false) { echo "OKn"; exit; } // ºê¶ó¿ìÀú¿ë (¼º°ø ¸Þ½ÃÁö) $successMsg = "✅ µ¥ÀÌÅͰ¡ Á¤»óÀûÀ¸·Î ÀúÀåµÇ¾ú½À´Ï´Ù."; } else { http_response_code(400); $errorMsg = "⚠️ ERROR: Invalid POST data (À߸øµÈ °ªÀÌ Àü¼ÛµÇ¾ú½À´Ï´Ù.)"; // curl / ¸ðµ© ¿äû ½Ã¿¡´Â ÅØ½ºÆ®·Î ÀÀ´ä if (php_sapi_name() === 'cli' || strpos($_SERVER['HTTP_USER_AGENT'] ?? '', 'curl') !== false) { echo "ERROR: Invalid POST datan"; exit; } } } // ------------------------------------------------------------ // 2️⃣ GET ¿äû ½Ã: latest.json ÆÄÀÏ Àбâ // ------------------------------------------------------------ $data = null; if (is_readable($jsonFile)) { $json = file_get_contents($jsonFile); if ($json) { $decoded = json_decode($json, true); if (is_array($decoded)) { $data = $decoded; } } } ?> Signaltech PSVG Monitor

Primesolution Monitoring

PSVG JSON Data Viewer (Auto refresh every 5 seconds)

✅ Latest data received

Ç׸ñ°ª
Device ID
Value
Timestamp

⚠️ No valid data found (JSON read or decode failed).

¿¹½Ã·Î POST ¿äûÀ» º¸³»·Á¸é:

curl -X POST "https://signaltech0.mycafe24.com/modem.php" 
     -H "Content-Type: application/json" 
     -d "{"device_id":"PSVG_01","value":227.5}"