firebird icon indicating copy to clipboard operation
firebird copied to clipboard

Cannot send file

Open VoxelPrismatic opened this issue 3 years ago • 49 comments

I have firebird 1.5 running on android 9 with the storage permissions enabled. I managed to get the CX CAS version 3.6.0.546 running but cannot transfer any file to the calculator. I try the same file on my PC and it works fine. does anybody know what the issue could be and how I can transfer files on android?

VoxelPrismatic avatar Oct 30 '20 17:10 VoxelPrismatic

Does the target folder exist already? Does the filename end in .tns? Is there anything helpful in the adb log?

Vogtinator avatar Oct 30 '20 19:10 Vogtinator

Yes the target folder exists. Yes the file name ends in .tns. This is the log, i cannot understand it: log.txt

VoxelPrismatic avatar Oct 30 '20 19:10 VoxelPrismatic

Unfortunately there's nothing useful in there. Are the filenames of boot1 and flash in the configuration shown correctly?

Vogtinator avatar Oct 30 '20 20:10 Vogtinator

Yes they do, and the emulator starts up fine

VoxelPrismatic avatar Oct 30 '20 20:10 VoxelPrismatic

Can you describe in which way it fails? After you select a file, does it say "Failed" immediately? To get logs from the device, please copy the flash image to a PC and run it, then download NspireLogs.zip.

Vogtinator avatar Oct 30 '20 20:10 Vogtinator

The funny thing is: it sends fine on PC, the issue is with the android app it takes about 3 seconds before it says "Status: Failed!"

VoxelPrismatic avatar Oct 30 '20 20:10 VoxelPrismatic

However, the transfer on desktop with the mobile UI stalls...

VoxelPrismatic avatar Oct 30 '20 20:10 VoxelPrismatic

Serial Monitor from Mobile UI on desktop:

image

20:56:59.860,20-10-30,0000000386,UDP SC: TI_UDP_BindIPAddr +++
20:56:59.860,20-10-30,0000000386,UDP SC: NU_Bind Successful
20:56:59.860,20-10-30,0000000386,UDP SC: TI_UDP_BindIPAddr ---
20:57:00.800,20-10-30,0000000480,dbgWirelessIconState(): !~!~!~!~!~!~!~!~    Wireless Icon:NoSled    ~!~!~!~!~!~!~!~!
autodim_power_callback
20:57:09.270,20-10-30,0000001327,UDP SC: allowUSBCallback(): allow USB connector: YES
autodim_power_callback
20:57:09.470,20-10-30,0000001347,CM: _____ streamChangeCallback called: cnhp=1176c568
20:57:09.470,20-10-30,0000001347,CM: StreamChangeCallback: Connector returned 1 entries
20:57:09.470,20-10-30,0000001347,CM: StreamChangeCallback: 1 entries to be added...
20:57:09.470,20-10-30,0000001347,CM: _____ Adding stream: nSpireDev0, type = 2
20:57:09.490,20-10-30,0000001349,sm_Connector:statemachineThread(): Enter->USBConnected. State->Idle.
20:57:09.490,20-10-30,0000001349,sm_Connector:statemachineThread(): Exit->USBConnected. State->USBConnected.
20:57:09.490,20-10-30,0000001349,Remote Stream (nSpireDev0) RX buf: 0x117864d4: 0.0
20:57:10.990,20-10-30,0000001399,Sending ADDR REQ packet to device stream: nSpireDev0 : 0.0:4003 0.0:4003 [seq=1] [siz=2]
20:57:10.990,20-10-30,0000001399,Exit ADDR REQ Send.
20:57:10.990,20-10-30,0000001399,CM: StreamChangeCallback: 0 entries to be removed...
20:57:10.990,20-10-30,0000001399,IS: RECV ADDR PKT 0x117874e4 from 0.0 : 100.0:4003 100.1:4003 [seq=1] [siz=4]
20:57:10.990,20-10-30,0000001399,CM: _____ Reassigned stream nSpireDev0 (np 0x11775050) to addr 100.0
20:57:10.990,20-10-30,0000001399,IS: process_addr_assign: DEFAULT max payload = 254
20:57:10.990,20-10-30,0000001399,CM: _____ Reassigned stream Local Node (np 0x1176E694) to addr 100.1
20:57:10.990,20-10-30,0000001399,IS: (ADDR TTL=0x0) ACK WINDOW SIZE = 1: 0.0
20:57:10.990,20-10-30,0000001399,CM: node_notify_cb: 100.1, event_type 0x00000001, np 0x11775050 (nSpireDev0)
20:57:10.990,20-10-30,0000001399,TI_NN_NotifyCallback Called. Node address =  0x6400. +++
20:57:10.990,20-10-30,0000001399,NN: Can Log In = true
20:57:10.990,20-10-30,0000001399,End of TI_NN_NotifyCallback. ---
20:57:10.990,20-10-30,0000001399,NN: Logged In = false
20:57:10.990,20-10-30,0000001399,cnConnectorCallback():NOTE_CN_NAVNET_LOGINSTATUS Logged in: 0
20:57:10.990,20-10-30,0000001399,TI_NN_Login Called.
20:57:10.990,20-10-30,0000001399,login: user name[0], password[NULL].
20:57:10.000,20-10-30,0000001400,LowAPI: Create New conHandle [11788598]: Src SYNC(4060) Dst:180(0180)
20:57:10.000,20-10-30,0000001400,TI_NN_Activate_Callback: Activate callback conn srcport 4060 destport 0180

20:57:10.000,20-10-30,0000001400, service handler is STARTING now, ch=11788598
20:57:10.000,20-10-30,0000001400,SYNC MSG: HandleOperationCallback RQST_TO_SEND_VAR_CMD (0x3)
20:57:10.000,20-10-30,0000001400,HandlePut localOverridePath<null> ch<11788598>
20:57:10.000,20-10-30,0000001400,SYNC: HandlePut() locPath<null>
20:57:10.000,20-10-30,0000001400,NNINIT: syncOperationCallback() type[PUT]
20:57:10.000,20-10-30,0000001400,FileLog: PutFile: /documents/home/priz/Documents/Pacman.tns
20:57:10.000,20-10-30,0000001400,SYNC: SendRequestPacket() len=0, ret=1
20:57:10.000,20-10-30,0000001400,SYNC: ReceiveFileData() size=30709
20:57:10.330,20-10-30,0000001433,SYNC: forcedFileRename() /tmp/11790b48.tmp --> /documents/home/priz/Documents/Pacman.tns
20:57:10.330,20-10-30,0000001433,SYNC: RenameFileFolder() /tmp/11790b48.tmp --> /documents/home/priz/Documents/Pacman.tns
20:57:10.330,20-10-30,0000001433,RenameFileFolder: utf8rename: <errno=2> </tmp/11790b48.tmp> </documents/home/priz/Documents/Pacman.tns>
20:57:10.330,20-10-30,0000001433,RenameFileFolder: returning error: <-264> </tmp/11790b48.tmp> </documents/home/priz/Documents/Pacman.tns>
20:57:13.700,20-10-30,0000001670,refreshApList```

VoxelPrismatic avatar Oct 30 '20 20:10 VoxelPrismatic

What's the target folder set to? If it's /, it did not get the right file name.

Vogtinator avatar Oct 30 '20 21:10 Vogtinator

/home/priz/Documents, which makes no sense if it's trying to write to

20:57:10.330,20-10-30,0000001433,RenameFileFolder: utf8rename: <errno=2> </tmp/11790b48.tmp> </documents/home/priz/Documents/Pacman.tns>
20:57:10.330,20-10-30,0000001433,RenameFileFolder: returning error: <-264> </tmp/11790b48.tmp> </documents/home/priz/Documents/Pacman.tns>

VoxelPrismatic avatar Oct 30 '20 21:10 VoxelPrismatic

Did you set that manually? It should be / by default.

Vogtinator avatar Oct 30 '20 21:10 Vogtinator

i did set it manually

VoxelPrismatic avatar Oct 30 '20 21:10 VoxelPrismatic

Ok, why? It means that it tries to send it into the calculator's /home/priz/Documents, which doesn't exist.

Vogtinator avatar Oct 30 '20 21:10 Vogtinator

its trying to send to /documents/home/priz/Documents, which does exist

and the default directory was /ndless

VoxelPrismatic avatar Oct 30 '20 21:10 VoxelPrismatic

The full path has to exist already, it does not create any path components.

Vogtinator avatar Oct 30 '20 21:10 Vogtinator

just curious, why does it put /documents first then?

20:57:10.000,20-10-30,0000001400,FileLog: PutFile: /documents/home/priz/Documents/Pacman.tns

VoxelPrismatic avatar Oct 30 '20 21:10 VoxelPrismatic

That's where the calculator stores documents internally. In exam mode, it's /exammode/usr instead.

Vogtinator avatar Oct 30 '20 21:10 Vogtinator

oh i see so i should try to set the directory to /documents on android and send the file

VoxelPrismatic avatar Oct 30 '20 21:10 VoxelPrismatic

No, that would fail as /documents/documents doesn't exist. Just set it to /, that is guaranteed to work.

Vogtinator avatar Oct 30 '20 21:10 Vogtinator

still fails on android

VoxelPrismatic avatar Oct 30 '20 21:10 VoxelPrismatic

Android or PC? In any case, logs are needed.

Vogtinator avatar Oct 30 '20 21:10 Vogtinator

says invalid path on PC in the serial log

21:58:15.520,20-10-30,0000002552,SYNC: HandlePut() locPath<null>  
21:58:15.520,20-10-30,0000002552, ParseVarRqst: Error: invalid path
21:58:15.520,20-10-30,0000002552, HandlePut: ParseVarRqst failed: <-276>

VoxelPrismatic avatar Oct 30 '20 21:10 VoxelPrismatic

What happens with an empty target directory?

Vogtinator avatar Oct 30 '20 22:10 Vogtinator

that works on PC, not android

VoxelPrismatic avatar Oct 30 '20 22:10 VoxelPrismatic

Both on Android and PC?

Vogtinator avatar Oct 30 '20 22:10 Vogtinator

just PC

VoxelPrismatic avatar Oct 30 '20 22:10 VoxelPrismatic

If it still fails on Android, please provide logs.

Vogtinator avatar Oct 30 '20 22:10 Vogtinator

I'm using adb logcat --pid=1594, should I use GDB instead?

VoxelPrismatic avatar Oct 30 '20 22:10 VoxelPrismatic

Fortunately not (using gdb manually is painful). https://github.com/nspire-emus/firebird/issues/221#issuecomment-719786350:

To get logs from the device, please copy the flash image to a PC and run it, then download NspireLogs.zip.

There's currently no way to receive documents using the Mobile UI...

Vogtinator avatar Oct 30 '20 22:10 Vogtinator

how do I run the flash and get NspireLogs.zip?, do I just run the flash in firebird? where is NspireLogs?

VoxelPrismatic avatar Oct 30 '20 22:10 VoxelPrismatic