Close

Can retrieve frame number but buffers issues are blocking

A project log for Nikon N90/N90s Film Cameras utils

Modern utils to get datas out and configure the Nikon N90/F90 and N90s/F90x film cameras that talks the Data Link protocol.

ValérianneValérianne 04/17/2021 at 16:111 Comment

I have started working on retrieving some settings and values, for now only the frame number works, everything else fails.

It seems I have something wonky on the side of buffers, I get some of the identification string when i dataRead() after sending a command to retrieve the frame number... where it shouldn't since after the identification we should be "clean", adding some libserialport flush didn't help.

dashie@ubuntu-shared:~/pikon$ ./pikon get_settings
16:06:28 INFO  src/nikonDatalink.cpp:36: Starting session.
16:06:28 INFO  src/nikonDatalink.cpp:133: libserialport version: 0.1.1
16:06:28 INFO  src/nikonDatalink.cpp:134: Port name: /dev/ttyUSB0
16:06:28 INFO  src/nikonDatalink.cpp:135: Description: FT232R USB UART - A50285BI
16:06:28 INFO  src/nikonDatalink.cpp:169: Identifying camera...
16:06:28 INFO  src/nikonDatalink.cpp:170: Sending wakeup string...
16:06:28 INFO  src/nikonDatalink.cpp:184: Sending nikon inquiry string...
16:06:30 INFO  src/nikonDatalink.cpp:184: Sending nikon inquiry string...
16:06:30 INFO  src/nikonDatalink.cpp:55: Camera is a N90/F90
Film present, frame 23
ISO: 6
Lens: id: 0 - focal min: - - ap min: 1
Focale: -
16:06:32 INFO  src/nikonDatalink.cpp:79: Ending session.

Here everything after the frame should not be empty (ISO should be 400). It is to be noted that the frame counter returned by the Nikon is the next frame so here it does -1 to show the actual one.

Verbosly annoying debug log:

Notes:

XXXXXXX is the limit between all the wakeup + identification part, and start of retrieval (sendCommand etc.)

The first retrieval is at address 0x0000FD21 which is the frame counter, and the readData after that command seems to return "F90/N90" which is part of the identification string. After ident we should be clear but something is wrong, adding libserialport flush didn't helped.

Somehow the retrieval of frame number ends up working, but every sendCommand after that fails and returns garbage.

Also adding a longer sleep (like 3 seconds) after ident make everything fails, but it might be due to how the protocol/mcu works.

16:14:01 INFO  src/nikonDatalink.cpp:169: Identifying camera...
16:14:01 INFO  src/nikonDatalink.cpp:170: Sending wakeup string...
16:14:01 DEBUG src/nikonDatalink.cpp:259: writeDataSlow: '', size: 1
16:14:01 INFO  src/nikonDatalink.cpp:184: Sending nikon inquiry string...
16:14:01 DEBUG src/nikonDatalink.cpp:259: writeDataSlow: 'S1000', size: 6
16:14:03 DEBUG src/nikonDatalink.cpp:345: readData: 'ED58CA84' / '', read: 0, expected: 1, err: -1
16:14:03 INFO  src/nikonDatalink.cpp:184: Sending nikon inquiry string...
16:14:03 DEBUG src/nikonDatalink.cpp:259: writeDataSlow: 'S1000', size: 6
16:14:03 DEBUG src/nikonDatalink.cpp:345: readData: 'ED58CA84' / '1', read: 1, expected: 1, err: 0
16:14:03 DEBUG src/nikonDatalink.cpp:345: readData: 'ED58CA85' / '0', read: 1, expected: 1, err: 0
16:14:03 DEBUG src/nikonDatalink.cpp:345: readData: 'ED58CA86' / '1', read: 1, expected: 1, err: 0
16:14:03 DEBUG src/nikonDatalink.cpp:345: readData: 'ED58CA87' / '0��X��', read: 1, expected: 1, err: 0
16:14:03 DEBUG src/nikonDatalink.cpp:345: readData: 'ED58CA88' / 'F�X��', read: 1, expected: 1, err: 0
16:14:03 DEBUG src/nikonDatalink.cpp:345: readData: 'ED58CA89' / '9X��', read: 1, expected: 1, err: 0
16:14:03 DEBUG src/nikonDatalink.cpp:345: readData: 'ED58CA8A' / '0��', read: 1, expected: 1, err: 0
16:14:03 DEBUG src/nikonDatalink.cpp:345: readData: 'ED58CA8B' / '/�', read: 1, expected: 1, err: 0
16:14:03 DEBUG src/nikonDatalink.cpp:345: readData: 'ED58CA8C' / 'N', read: 1, expected: 1, err: 0
16:14:03 DEBUG src/nikonDatalink.cpp:345: readData: 'ED58CA8D' / '9', read: 1, expected: 1, err: 0
16:14:03 DEBUG src/nikonDatalink.cpp:345: readData: 'ED58CA8E' / '0', read: 1, expected: 1, err: 0
16:14:03 DEBUG src/nikonDatalink.cpp:345: readData: 'ED58CA8F' / '', read: 1, expected: 1, err: 0
16:14:03 DEBUG src/nikonDatalink.cpp:345: readData: 'ED58CA90' / 'WX��', read: 2, expected: 2, err: 0
16:14:03 INFO  src/nikonDatalink.cpp:55: Camera is a N90/F90
16:14:04 INFO  src/main.cpp:124: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
16:14:04 DEBUG src/nikonDatalink.cpp:383: Sending command, mode: 0x80, address: FD21, buffer: , size: 1
16:14:04 DEBUG src/nikonDatalink.cpp:434: Sending command loop, mode: 0x80, address: FD21, buffer: , size: 1
16:14:04 DEBUG src/nikonDatalink.cpp:293: writeData: 'ED58C960'
16:14:04 DEBUG src/nikonDatalink.cpp:584: reading a data packet with buf=, size=1
16:14:04 DEBUG src/nikonDatalink.cpp:345: readData: 'ED58CA84' / 'F90/N90', read: 4, expected: 4, err: 0
16:14:04 DEBUG src/nikonDatalink.cpp:293: writeData: 'ED58C960'
16:14:04 DEBUG src/nikonDatalink.cpp:584: reading a data packet with buf=, size=1
16:14:04 DEBUG src/nikonDatalink.cpp:345: readData: 'ED58CA84' / '', read: 4, expected: 4, err: 0
1 buf: 0xf1 partial: 0x1, address: 0xFD21
buf: 358217969
2 buf: 0xf2, partial: 0x1, address: 0xFD21
16:14:04 DEBUG src/nikonDatalink.cpp:383: Sending command, mode: 0x80, address: FD25, buffer: , size: 9
16:14:04 DEBUG src/nikonDatalink.cpp:434: Sending command loop, mode: 0x80, address: FD25, buffer: , size: 9
16:14:04 DEBUG src/nikonDatalink.cpp:293: writeData: 'ED58C960'
16:14:04 DEBUG src/nikonDatalink.cpp:584: reading a data packet with buf=, size=9
16:14:05 DEBUG src/nikonDatalink.cpp:345: readData: 'ED58CA84' / '', read: 12, expected: 12, err: 0
1 buf: 0xf2 partial: 0x9, address: 0xFD25
buf: 358217970
2 buf: 0xfb, partial: 0x9, address: 0xFD25

Discussions

Valérianne wrote 04/24/2021 at 08:06 point

it is to be noted that putting the sendCommand for ISO before FrameNumber does retrieve the ISO, only the first sendCommand works, the others fails

  Are you sure? yes | no