I developed a flutter application for raspberry pi that receives the UUID number of the device.
When I run it on Linux I get the following error:
/sys/firmware/dmi/tables/smbios entry point: Permission denied
/dev/mem: Permission denied
In addition to the previous log, I also receive the following error:
Unhandled Exception: MissingPluginException (No implementation found for method getUDIDon chanmel flutter_udid) MethodChannel._invokeMethod (package:flutter/src/services/platforn_channel.dart:320) chronous suspension> FlutterUdid.consistentudid (package:flutter_udid/flutter_udid.dart:22) chronous suspension> RoutePageState. loadBasics (package:my_app/routes.dart:73) chronous suspension
The code in the ROUTE.DART file on line 73 is:
macAddress = await FlutterUdid.consistentUdid;
void loadBasics() async {
String? macAddress;
String? version;
try {
macAddress = await FlutterUdid.consistentUdid;
PackageInfo packageInfo = await PackageInfo.fromPlatform();
version = packageInfo.version;
} on PlatformException {
macAddress = 'Failed to get mac address.';
}
if (!mounted) return;
print(macAddress);
Future.delayed(Duration(seconds: 5), () {
// Do something
});
final SharedPreferences storage = await SharedPreferences.getInstance();
// await DesktopWindow.setFullScreen(true);
String? stationId = await storage.getString('stationId');
if (stationId == null) {
Get.off(() => Setup());
return;
}
http.Response response = await http.post(Uri.parse('https://**************/configure'), body: jsonEncode(<dynamic, dynamic>{
'key': stationId,
'mac': macAddress.toString(),
'version':version.toString()
}));
final result = jsonDecode(response.body);
print(response.body);
if (!result['success']) {
await storage.clear();
Get.off(() => Setup());
return;
}
Get.off(() => LiveFeed());
//Get.snackbar('', '', titleText: Directionality(textDirection: TextDirection.rtl, child: Text('אירעה שגיאה!', style: GoogleFonts.heebo(color: Colors.red, fontWeight: FontWeight.bold, fontSize: 12.sp))), messageText: Directionality(textDirection: TextDirection.rtl, child: Text(data['error'], style: GoogleFonts.heebo(color: Colors.red, fontSize: 11.sp))), snackPosition: SnackPosition.BOTTOM);
}
It should be noted that in Windows it works perfectly.
The question is do I need to give a certain permission in Linux / raspberry pi? I run the project using SUDO.
I would appreciate advice on the matter.
The goal is for the device to send a request to the server and be identified as a UUID / MAC address to check if the device is approved by the server.
Thank you !