Cannot download to PYGAMER

Looks like you should be fine! Are you using the filesystem to flash or webusb? webusb can be a little buggy

I am not aware of using a full screen image. Is there something in the code that suggests otherwise?

Also based on my previous reply, and the way I have coded the game, is there anything I should change? I know I have a lot of functions, probably too many, and have also defined many variables (sometimes just to make debugging the game easier). So if you have any suggestions, I would love to hear from you. I want to make the game ‘leaner’, and I know I can do with a few less sprites. I look forward to your advice.

I was doing both. I read at adafruit that Chrome works better (webusb). The weird thing is, is that it works now. The entire day, not at all. So maybe it’s a combination of things, I’m not sure.

We do tree shaking on the compiled code, so the only code included in the binary is code that is actually referenced. It’s possible that the extension references you mentioned removed from the code were bringing in a lot of code. Other than that, I dunno. If you have a version of the project that does not download I might be able to poke around when I have some free time.

I only have the .uf2 files, but I can’t upload them. I could share them if you like. I guess it’s not a problem now, but if it happens again, can I send you another post here?

I apologize for jumping to conclusions. It was after a commented out parts of the code using the image transform extension, that it worked again. Shortly after, I put the code back, and I was still able to upload the game. So I am completely out of wits what was causing the problem, except that it must be my computer, the usb cable or the Arcade gods playing tricks on me. Sorry.

I have a few thoughts, some related to the memory concerns raised, and some related to your specific issue.

Regarding the Rotate Sprites extension: I do not believe I have tested it on hardware, so I do not know how it performs. It takes for granted the amount of memory in a browser, so it may exceed the RAM available on the hardware platform.

Along those lines, static images that are included with your project do not occupy space in RAM. So, if you’re running into the memory limit, I’d create the images in blocks and store the images in arrays, and then select the appropriate image from the arrays as needed. As @richard mentioned, dynamic images can quickly use up the available RAM on these hardware devices.

Regarding your specific situation, if the device is generating an error code, some of them have been documented here:

I don’t have a hardware device on hand at the moment. I probably should have one on-hand here in my remote office, now that I’m spending more time here. Anyway, if you continue to have difficulties, let us know what error messages you are getting.

@AlexK I was talking about the code size, not the RAM usage. RAM usage is for sure the much more common issue but I have seen 1 or 2 games that hit the flash limit.

Like Alex mentioned, if you hit an issue with memory usage you’ll get an error code on the device

I wasn’t getting any error codes trying to upload the game or while playing it. I wasn’t able to upload the game via Makecode (webusb) or via the computer by dragging the .uf2 file. During the transfer the device showed the bootstrapping screen, it flickered blank for a second but showed the bootstrapper screen again. Eventually I did get it to work, but the problem is I don’t know what got it to work. I was just thinking that maybe the size of the game might have been the problem, but it may have just been my computer, the usb cable (as I kept trying different ones) or webusb finally working.
I thank you :two_hearts: all for helping out with this issue, as you can imagine I was devastated to finish part of the game and to not have it work on the pygamer, but it is working now. I’ll keep my fingers crossed each time I upload and hope that I don’t have any problems in the future.

1 Like

Hi @richard,

I made a few changes to my game (the biggest being the array of images for the player) after which I can no longer upload the game to my PyGamer. Sometimes when I commit changes to GitHub, while in the blocks view, I see a message saying that the blocks may be damaged or corrupted. Can you see if there is anything wrong with the code, and are you able to upload to a PyGamer? (if you have one).

After many attempts not being able to download the game, I saw a brief popup from the bottom the editer saying ‘Compilation failed contact support’.

Hmm, yes I’m able to flash that to my pygamer. Could you check the developer tools console for your browser and see if any exceptions are printed out?

Hi @richard
A support member at Adafruit said that they also had a problem downloading the game, and asked if I could display the errors in the console.

I am not able to attach the .log file from Microsoft Edge, but the following is shown in the Console when loading in the game. I hope you are able to help.

Summary of errors:

  • [Deprecation] Application Cache API manifest selection is deprecated and will be removed in M85, around August 2020. (Warning)
  • Bad HTTP status code: 404 (Error)
  • Deprecated use of setting size_.width to 0 to rerender a field. Set field.isDirty_ to true instead. (Warning)

I couldnlt paste in the entire log, it exceeded that max characters of 32000 : -) I’ve uploaded the log files to my Google Drive:

(froggingFun-log-20201022.txt) This is the log from today, and the summary of errors are above.
The other files were made yesterday, so in the order of:


I just updated my bootloader to 3.10.0 and I still have no trouble flashing the device using the version you linked.

How are you copying it over? Can you try downloading it a folder other than the device and then manually dragging it over? We’ve seen a few isolated issues in the past when downloading directly to the device drive.

Other than that my only guess is that it has something to do with you being on Windows (I’m on a mac). @jwunderl do you have a PC you can give this a try with?

Also thanks for the logs, nothing looks amiss from what I can see.

Yeah, tested windows / latest build (ish) and it flashed correctly.

@cosmoscowboy From those logs, it looks like it 404d trying to get to, which doesn’t exist – it’s possible that just creating the repo (and switching the branch from main to master for now, as we have work to do to accommodate new options for default branches) would fix that? Not sure right away, have you tried to upload it before?

Just to confirm, if you click the dropdown to the right of the download button, it does say Adafruit PyGamer exactly like this, right?


Hi Joey, thanks for getting back to me. I’ve tried everything. Microsoft Edge, Chrome, another laptop. Also via webusb or by dragging the downloaded game from my computer to the drive of the pygamer. I do see the correct device when trying to download it.

This is in Chrome.
Latest version:

As discussed here, Array of animations, I have created a new version, and the 404 errors have disappeared. That’s good. If only I could find a way to get it work on my PyGamer.

I’m having the same issue on a game I am working with my son. We were able to download to his Pygamer, but after changing from color-coded tilemaps to the new tilemap API we aren’t able to do so. It exhibits the same behavior you described. I am having no issues with other games.

I cannot pinpoint a behavior that prevents me from uploading games on to my PyGamer. In the game that I posted, it is using the color-code tilemap. I was able to upload the game in the beginning, but after some time (I guess more code, animations, etc), it no longer works. I am no longer working on this game. I think the issue is quite random. For the game I posted for the Ocean Jam, Shark Frenzy, it does not use a tilemap and I cannot upload it either. The game saved in GitHub does not work, but when I create a new project, not hosted in GitHub, and copy the entire code over, I can upload it. Personally I believe that once a game reaches a certain size, it just doesn’t work. Perhaps it could also be if it hosted in GitHub, as others were able to upload a shared version. It is a conundrum that is somewhat annoying, but so long as the game works in a browser, and on a mobile phone, that I don’t mind so much; except for the investment made in the hardware. :wink:

I was able to get the game to download to his Pygamer.

I removed all color-coded timemap tiles, and remapped all existing maps to use all the earlier maps stored in tilemap.g.ts and tilemap.g.jres: level, level_0, level _1… etc.

I created a new project, copied and pasted the JavaScript, and fixed all mismatched tiles on Overlap functions. After getting the game working, I was able to download the game to the Pygamer. I saved the game as a PNG and then made a few minor changes then commited and pushed my changes to a new Git repo. After doing this, I was not able to download to the Pygamer. I then deleted the project and Git repo and imported the saved PNG. I made the same changes and was able to download to the Pygamer. So far that is working. I will not release it to Git until the game is ready for release.

1 Like