Read/write jw24f14 hid

This is the English forum for all topics related to JoyWarrior. Please post in English only

Moderator: Guido Körber

Post Reply
novitsky
Posts: 4
Joined: Tue Jul 31, 2012 6:16 am
Location: TAU
Contact:

Read/write jw24f14 hid

Post by novitsky »

Hello,
I'm trying to write a python/c code to read the JW24f14 data and control the range/band options.
I try to use the usblib to communicate with the hid interface as describe in chapter 5.5 in the datasheet: http://www.codemercs.com/uploads/tx_sbd ... eet_01.pdf
I couldn't understand the report structure - what should be entered in the write report and what in the read report when using pyusb or usblib functions.
I'm using Fedora 17 Linux system. I use libusb_control_transfer function based on this code: http://www.lvr.com/code/generic_hid.c (attached)
should I send 2, 4 or 8 bytes?
the write report 0x80 return zeros.
the write report 0x82 return a read report of 0x02 and zeros but then the connection is lost and I have to re-plug the device in order to use it.
any advice?

Thanks,
Novitsky
Attachments
joyworrier24f14_generic_hid_usblib.txt.zip
C code for communicating with the JW24F14 using libusb
(2.42 KiB) Downloaded 724 times
novitsky
Posts: 4
Joined: Tue Jul 31, 2012 6:16 am
Location: TAU
Contact:

Re: Read/write jw24f14 hid

Post by novitsky »

I managed to write a c code for Linux that communicates with JoyWarrior24F14 via HID.
Feel free to use on your own risk.
It is in a working process so not all functionality is done.
in order to use it you must run as root or adjust udev rules.
Attachments
JoyWarrior24f14.c.Linux.zip
instruction inside.
(7.53 KiB) Downloaded 688 times
aut disce aut discede
http://www.bgu.ac.il/~novitsky
User avatar
Christoph Jung
Posts: 670
Joined: Sun Oct 08, 2006 3:43 pm
Location: Germany / Berlin
Contact:

Re: Read/write jw24f14 hid

Post by Christoph Jung »

Thanks for that.
I have also do some test with the libusb but I could not compile a working application.
So I have used hidapi to connect the JoyWarrior24F14 with Linux.
Abteilung: Softwareentwicklung
Folge uns auf Twitter
Follow us on twitter
jimjack
Posts: 1
Joined: Fri Jan 04, 2013 3:41 pm

Re: Read/write jw24f14 hid

Post by jimjack »

Hi Novitsky,

thanks for your excellent work.

I live in Germany and have also a JoyWarrior 24F24. I use your sowftare with a few changes.
This "new" software works like a seismometer daemon.
Unfortunately, there are almost nothing to detect here in my region in Germany ;-).

There are new routines for creating init values for comparison with the actual values. You can set a pause time
between reading values, a trigger value for writing seismometer data to a log file and also set the write time
for such a trigger event.
The data are written to a file like <seis_log_20130205.txt>. With this file you can generate a diagram with
GNUPlot.

For this new functions you must use the new parameter -t.

It is not a real daemon. You must start the pogramm with nohup like this

nohup joytest2 -t 50 500 0.008 >/dev/null &

It compiles and runs without any problems under Debian 6 Linux. You get a hugh amount of data.
The files have round about 120...150Mbyte on my machine.

Attached the my source code. It's not perfect und must be expanded but I hope this will help you
and others.

With best regards,
Steffen
Attachments
joytest2_V024_20130205.zip
(10.3 KiB) Downloaded 638 times
Post Reply