Hello,
I am currently attempting to create a system whereby I can use a ZigBEE JN5169 Microcontroller to return temperature, using its built-in temperature measuring capabilities.
I need the temperature readings to then be sent to a raspberry pi which has a JN5169 USB Dongle for ZigBee attached to it. The Information should then be able to be viewed on the raspberry pi.
What I have done so far:
Can someone tell me where I can find the relevant information to form the connection between the JN5169 microcontroller and the raspberry pi (USB Dongle)?
Also, how would I go about writing the code (in C I believe) for returning the temperature?
Many Thanks,
Hi Alexis,
I went through the JN-AN-1220 documentation, ZigBee 3.0 Sensors, documentation, and I did'nt find anything sugesting as to why the .bin file is printing said infomration instead of temperature...
I belive my problem of right now is that of interepreting the output, rather than reciving the information in time intervals.
What does the output I am reciving in the IDE terminal mean?
Thanks,
HI Suhaib,
All information for debugging, you can find in Makefile. E.g:
TRACE ?=0
ifeq ($(TRACE), 1)
#CFLAGS += -DDBG_ENABLE
#CFLAGS += -DDEBUG_921600
#CFLAGS += -DDEBUG_EZMODE
#CFLAGS += -DDEBUG_ZCL
#CFLAGS += -DDEBUG_CLD_ONOFF
#CFLAGS += -DDEBUG_APP_BUTTON
#CFLAGS += -DDEBUG_APP_OTA
#CFLAGS += -DDEBUG_START_UP
CFLAGS += -DDEBUG_SENSOR_NODE
#CFLAGS += -DDEBUG_SENSOR_TASK
#CFLAGS += -DDEBUG_SCAN
#CFLAGS += -DDEBUG_JOIN
CFLAGS += -DDEBUG_COMMISSION
#CFLAGS += -DDEBUG_SENSOR_STATE
CFLAGS += -DDEBUG_SLEEP_HANDLER
#CFLAGS += -DDEBUG_LIGHT_SENSOR
#CFLAGS += -DDEBUG_POLL_HANDLER
#CFLAGS += -DDEBUG_PROCESS_BUTTONS
#CFLAGS += -DDEBUG_ZCL_PROCESSING
#CFLAGS += -DDEBUG_REPORT
#CFLAGS += -DDEBUG_NWK_EVENT_HANDLER
#CFLAGS += -DDEBUG_APP_NTAG
#CFLAGS += -DDEBUG_APP_ICODE
#CFLAGS += -DDEBUG_EVENT_HANDLER
CFLAGS += -DDEBUG_BDB
#CFLAGS += -DTRACE_OTA_DEBUG
#CFLAGS += -DDEBUG_BLINK_LED
endif
Uncomment to enable and otherwise.
Dear Suhaib,
Please check in the App_LightTemperatureOcupancySensor.c the following function:
There you can find the temperature, check if your code enter this function. Also you'll need to add the following lines to the makefile:
CFLAGS += -DDEBUG_LIGHT_TEMP_OCC_SENSOR
APPSRC += App_LightTemperatureOccupancySensor.c
This to enable this print in the debug console.
The message you mention is only the MCU status. In this case the handler is from the sleep mode. The MCU only is going to sleep at time intervals.
But I don't think that you're sending any message to your coordinator yet. Please check in the JN-AN-1220-ZigBee-3-0-Sensors the finding and binding section, after binding the nodes, the temperature will be reported to the node at a certain interval. After that you will need to locate where the package is received in the control bridge example.
You'll need to download the JN-AN-1216, this project is the control bridge. There, after you bind the coordinator and the end device you'll start receiving the messages in the coordinator console.
I hope this helps you.
Best Regards,
Alexis Andalon
Hi Suhaib,
To answer your first question, the USB dongle opens a VirtualCOM port in the host device. So you only need that the raspberry Pi recognize this kind of device and a serial terminal.
Also of how to implement the temperature measurement, please check the JN_AN1220 and check the
LightTemperatureOccupancySensor, this has an endpoint with temperature measurement, you can base your application in this project. ZigBee 3.0 | NXP
Best Regards,
Alexis Andalon
Thank you for your reply Alexis.
I have understood your comment on forming the connection between the chip and the Pi.
I have gone ahead and download the JN-AN-1220 file and saved the file:
"LightTemperatureOccupancySensor_NtagIcode_JN5169_DR1175.bin"
to the chips flash memory via command line (JN51xxProgrammer.exe -s COM19 -f LightTemperatureOccupancySensor_NtagIcode_JN5169_DR1175.bin).
When I then run it and view the output on the Beyond Studio IDE terminal, I get:
APP Sleep Handler: Task Timers = 2
APP Sleep Handler: u8TimerTick
APP Sleep Handler: Activity Count = 4
APP Sleep Handler: u8TimerBlink
APP Sleep Handler: u8TimerPowerOnCount
Could you please as to how I can work on this to return temperature?
Thanks
Hi Suhaib,
Please check the in the JN-AN-1220 documentation, ZigBee 3.0 Sensors, the section:
This will help you receive the information in time intervals.
Best Regards,
Alexis Andalon
Hi Alexis,
I went through the JN-AN-1220 documentation, ZigBee 3.0 Sensors, documentation, and I didn’t find anything suggesting as to why the .bin file is printing said information instead of temperature...
I believe my problem of right now is that of interpreting the output, rather than receiving the information in time intervals.
What does the output I am receiving in the IDE terminal mean? Is it encrypted? Do I need a key to decrypt it?
Kind Regards