Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot send file #221

Open
VoxelPrismatic opened this issue Oct 30, 2020 · 49 comments
Open

Cannot send file #221

VoxelPrismatic opened this issue Oct 30, 2020 · 49 comments

Comments

@VoxelPrismatic
Copy link

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?

@Vogtinator
Copy link
Member

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

@VoxelPrismatic
Copy link
Author

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

@Vogtinator
Copy link
Member

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

@VoxelPrismatic
Copy link
Author

VoxelPrismatic commented Oct 30, 2020

Yes they do, and the emulator starts up fine

@Vogtinator
Copy link
Member

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.

@VoxelPrismatic
Copy link
Author

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
Copy link
Author

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

@VoxelPrismatic
Copy link
Author

VoxelPrismatic commented Oct 30, 2020

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```

@Vogtinator
Copy link
Member

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

@VoxelPrismatic
Copy link
Author

/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>

@Vogtinator
Copy link
Member

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

@VoxelPrismatic
Copy link
Author

i did set it manually

@Vogtinator
Copy link
Member

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

@VoxelPrismatic
Copy link
Author

VoxelPrismatic commented Oct 30, 2020

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

and the default directory was /ndless

@Vogtinator
Copy link
Member

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

@VoxelPrismatic
Copy link
Author

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

@Vogtinator
Copy link
Member

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

@VoxelPrismatic
Copy link
Author

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

@Vogtinator
Copy link
Member

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

@VoxelPrismatic
Copy link
Author

VoxelPrismatic commented Oct 30, 2020

still fails on android

@Vogtinator
Copy link
Member

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

@VoxelPrismatic
Copy link
Author

VoxelPrismatic commented Oct 30, 2020

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>

@Vogtinator
Copy link
Member

What happens with an empty target directory?

@VoxelPrismatic
Copy link
Author

VoxelPrismatic commented Oct 30, 2020

that works on PC, not android

@Vogtinator
Copy link
Member

Both on Android and PC?

@VoxelPrismatic
Copy link
Author

just PC

@Vogtinator
Copy link
Member

If it still fails on Android, please provide logs.

@VoxelPrismatic
Copy link
Author

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

@Vogtinator
Copy link
Member

Fortunately not (using gdb manually is painful). #221 (comment):

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...

@VoxelPrismatic
Copy link
Author

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

@Vogtinator
Copy link
Member

Vogtinator commented Oct 30, 2020

do I just run the flash in firebird?

Yep. Make sure to save the flash in Android first, so that it contains the latest entries.

where is NspireLogs?

You'll see it when refreshing the browser in the file transfer window.

@VoxelPrismatic
Copy link
Author

it isn't in the logs surprisingly

@VoxelPrismatic
Copy link
Author

i have this when its blank:

18:31:11.320,20-10-18,0000128032, service handler is STARTING now, ch=11775f9c
18:31:11.320,20-10-18,0000128032,SYNC MSG: HandleOperationCallback RQST_TO_SEND_VAR_CMD (0x3)
18:31:11.320,20-10-18,0000128032,HandlePut localOverridePath<null> ch<11775F9C>
18:31:11.320,20-10-18,0000128032,SYNC: HandlePut() locPath<null>  
18:31:11.320,20-10-18,0000128032,ParseVarRqst: Error: invalid path
18:31:11.320,20-10-18,0000128032,HandlePut: ParseVarRqst failed: <-276>

@VoxelPrismatic
Copy link
Author

or with the slash, im not sure. the test file Pacman.tns doesn't appear in the logs anywhere

@Vogtinator
Copy link
Member

My suspicion is that the filename detection for files sent from Android is somehow broken. That's apparently not logged anywhere currently... Here's a build which logs a bit more (untested): https://owncloud.ritter-vogt.de/index.php/s/OaTBMlqPOkmXgyR

@VoxelPrismatic
Copy link
Author

It stopped logging altogether now.

@VoxelPrismatic
Copy link
Author

doesn't help that I cannot see the checkboxes for my options, i don't know if it's trying to log or not.

@VoxelPrismatic
Copy link
Author

i should say that i dont think it was logging previously either

@Vogtinator
Copy link
Member

It stopped logging altogether now.

That sounds odd, I only added calls to __android_log_write.

doesn't help that I cannot see the checkboxes for my options, i don't know if it's trying to log or not.

Which options?

@VoxelPrismatic
Copy link
Author

Screenshot_20201031-122941

@VoxelPrismatic
Copy link
Author

I can't see any on any screen

@Vogtinator
Copy link
Member

That looks very broken, like it failed to load or generate the style. That's something for another issue though.

@VoxelPrismatic
Copy link
Author

maybe its related in the way that it doesnt have permissions or something?

@Vogtinator
Copy link
Member

No idea. I'd need to see logs.

@LanHikari64
Copy link

I also have this issue, along with the checkboxes not appearing.

@atticusrussell
Copy link

I've got this issue as well.

@Vogtinator
Copy link
Member

I was able to reproduce the styling issue with an Android 12 AVD. The fix is simple: Just increase targetSdkVersion to at least 28.

I was also able to reproduce the original issue here, sending files fails most of the time. Not sure why yet, needs some further debugging. It's surprisingly not related to the file access.

Vogtinator added a commit to Vogtinator/firebird-fork that referenced this issue Mar 24, 2022
That's necessary for style extraction to work.

Fixes nspire-emus#221
@Vogtinator Vogtinator self-assigned this Mar 24, 2022
@Vogtinator
Copy link
Member

I was also able to reproduce the original issue here, sending files fails most of the time. Not sure why yet, needs some further debugging. It's surprisingly not related to the file access.

That was unfortunately CX II specific, so not the same as the issue reported here.

At least the broken UI is fixed with #257 though.

@Vogtinator Vogtinator removed their assignment Mar 28, 2022
@TotallyNotSethP
Copy link

I have the same issue on Android

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants