@mj SInce the for string for pack contains only two fields, it must be written as:
_LORA_PKG_FORMAT = "Bf"
pkg = struct.pack(_LORA_PKG_FORMAT, DEVICE_ID, D)
But besides that, the receiver must contains a lora_sock.recv(64) call, in order to get something. Please have a look at the simple examples in the documentation on how the code structure has to be set up.