2024-03-12 23:26:23 +01:00
|
|
|
#include <iostream>
|
2024-03-13 00:18:10 +01:00
|
|
|
#include <string>
|
|
|
|
|
|
2024-03-13 16:54:03 +01:00
|
|
|
#include <chrono>
|
|
|
|
|
#include <thread>
|
|
|
|
|
|
2024-03-13 00:18:10 +01:00
|
|
|
#include "hoymiles.h"
|
|
|
|
|
#include "modbus.h"
|
2024-03-12 23:26:23 +01:00
|
|
|
|
|
|
|
|
int main(){
|
|
|
|
|
|
2024-03-13 00:18:10 +01:00
|
|
|
std::string ip_address {"192.168.31.136"};
|
|
|
|
|
int port {502};
|
|
|
|
|
|
2024-03-15 11:46:44 +01:00
|
|
|
// Dtu dtu {ip_address.c_str(), port};
|
|
|
|
|
// while(true) {
|
|
|
|
|
// dtu.updateMicroinverters();
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
Port hoymilesPort{modbus_new_tcp(ip_address.c_str(), port), 0x1000};
|
|
|
|
|
|
|
|
|
|
hoymilesPort.updateParameters();
|
2024-03-12 23:26:23 +01:00
|
|
|
|
2024-03-16 15:55:45 +01:00
|
|
|
std::shared_ptr<PortParameter> temp{hoymilesPort.getParameterById(0)};
|
|
|
|
|
float temp2 = temp.get()->getValue();
|
2024-03-12 23:26:23 +01:00
|
|
|
return 0;
|
|
|
|
|
}
|