fiduciary

Author Topic: TeensySaber Software Discussion  (Read 67057 times)

0 Members and 3 Guests are viewing this topic.

Offline bobi-one

  • No Force
  • *
  • Posts: 43
  • Um...Hello?
Re: TeensySaber Software Discussion
« Reply #240 on: February 03, 2018, 01:02:08 PM »
I am dazzled. All My sd cards I used so far ( class10 toshiba 8G, Kingston 16G) show really low performance , around 300 kb/s.

Offline KanyonKris

  • Padawan Learner
  • **
  • Posts: 72
  • Um...Hello?
Flicker preset and SmoothSwing V2
« Reply #241 on: February 04, 2018, 07:45:58 AM »
A quick video of the flicker preset I posted 2 days ago and SmoothSwing V2 in action.


Offline miib123

  • No Force
  • *
  • Posts: 20
  • Um...Hello?
Re: TeensySaber Software Discussion
« Reply #242 on: February 04, 2018, 01:28:55 PM »
Hello guys! I'm new one here :)

I'm having a nightmare with my V1 setup. I've been on a same spot for like 1 week now. I would really appreciate your help.

In general, my setup differs only in "booster" and "SD adapter" selection. I used booster "TPS61200-Boost-Converter-Module-Support-Down-Conversion-and-Disable-Mode", which got the same chip as Li-Po booster and microSD reader "SPI-Reader-Micro-SD-Memory-Card-TF-Memory-Card-Shield-Module-for-Arduino-AD", which got the same pinout as teensy's adapter.

The problem is, that my teensy is very unstable and causes different errors, displayed in serial monitor. Right now i managed to get microSD card (Formated as FAT16) up and running and displaying the files on it but i cannot play them (Message: "failed to read 20 bytes"). "Beep" command works.

I know, there could be million errors posible but i would be really happy if you could help me cause i wanna make a suprise for my dad.

PS: I'm using the latest firmware release.


Thank you!!



Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: TeensySaber Software Discussion
« Reply #243 on: February 04, 2018, 02:50:57 PM »
Hello guys! I'm new one here :)

I'm having a nightmare with my V1 setup. I've been on a same spot for like 1 week now. I would really appreciate your help.

In general, my setup differs only in "booster" and "SD adapter" selection. I used booster "TPS61200-Boost-Converter-Module-Support-Down-Conversion-and-Disable-Mode", which got the same chip as Li-Po booster and microSD reader "SPI-Reader-Micro-SD-Memory-Card-TF-Memory-Card-Shield-Module-for-Arduino-AD", which got the same pinout as teensy's adapter.

The problem is, that my teensy is very unstable and causes different errors, displayed in serial monitor. Right now i managed to get microSD card (Formated as FAT16) up and running and displaying the files on it but i cannot play them (Message: "failed to read 20 bytes"). "Beep" command works.

I know, there could be million errors posible but i would be really happy if you could help me cause i wanna make a suprise for my dad.

PS: I'm using the latest firmware release.


Thank you!!

You're right, there could be a million things that could cause these sort of problems. Generally, the best way to find these sort of things is to disconnect or replace one part at a time until things works better.

First thing, whenever things are flaky, or multiple parts seems to behave badly, it's most likely a power problem. Check your battery, check the wiring, try a different booster. Try hooking things up to a 5v power supply instead of the booster.

Second, it sounds like you have a problem with the sd card. That could of course be caused by a problem elsewhere, but sd card problems can also cause crashes and hangs which makes the whole thing behave erratically. How long are the wires to the sd card? Try a different sd card? Try using the serialflash instead?

If all else fails, some pictures of your setup may provide clues or more ideas for things to try.

Offline miib123

  • No Force
  • *
  • Posts: 20
  • Um...Hello?
Re: TeensySaber Software Discussion
« Reply #244 on: February 05, 2018, 07:49:11 AM »
Hey, thank you for your quick answer! :) I'm sorry for lack of information i gave. I did not have a lot of time.I tought the same about power problem. Now i just connected a 5V power suppy to have a solid input. I bypassed the booster and must say, that this act got my LED strip working and can even toogle through the different fonts (colors). There is still no sound but i can hear a very quiet scrachy sound, comming from the speaker (2W, 8ohm), but is not the .wav file.

Dir command works like a charm but i stil cannot play any of the wav files (made them with audacity).

About SDcard... I've tried two 1gb microSD cards, which performs great with my mobile phone, USB reader, etc. I formated them in FAT16 format with SDformatter. I tried even two microSD card readers but the same problem persist. I used AWG26 wires for connecting SDcard adapter. Lenght is about 90mm. As a electrician, my soldering skills are pretty good too.

I tried to use the serialflash method but honestly don't know how to upload the files onto chip :S

Thanky you again and looking forward for your answer. :)

Offline miib123

  • No Force
  • *
  • Posts: 20
  • Um...Hello?
Re: TeensySaber Software Discussion
« Reply #245 on: February 05, 2018, 08:00:27 AM »
Oh and i almost forgot. Every time, teensy boots up, speaker speaks out the words sounding like "BAD OPEN FAILURE" or "BATCH OPEN FAILURE".

Offline KanyonKris

  • Padawan Learner
  • **
  • Posts: 72
  • Um...Hello?
Re: TeensySaber Software Discussion
« Reply #246 on: February 05, 2018, 08:22:37 AM »
Oh and i almost forgot. Every time, teensy boots up, speaker speaks out the words sounding like "BAD OPEN FAILURE" or "BATCH OPEN FAILURE".
Pretty sure it's BANK OPEN FAILURE and usually it means files cannot be read from the microSD card.

Now that you're getting more stable operation with the 5V supply, it's very helpful to use the serial monitor to verify proper boot, operation and look for errors. In the Arduino IDE go to Tools | Serial Monitor. 9600 baud is fine, and left of the Baud setting make sure Newline is selected. Also make sure you have the correct serial port selected ( Tools | Port, usually the correct port will say (Teensy) next to it. And be sure you USB is set to Serial (Tools | USB Type:). When you power up the Teensy with the USB cable connected, open the Serial Monitor and you should see lines of text printing out. You can also enter commands to test many functions.

The Troubleshooting page is full of good info - Teensy Saber Troubleshooting

Also, many topics like this have been discussed before so search back through this thread. For instance, a search for BANK turned up some good info.
 

Offline miib123

  • No Force
  • *
  • Posts: 20
  • Um...Hello?
Re: TeensySaber Software Discussion
« Reply #247 on: February 05, 2018, 09:39:30 AM »
Oh and i almost forgot. Every time, teensy boots up, speaker speaks out the words sounding like "BAD OPEN FAILURE" or "BATCH OPEN FAILURE".
Pretty sure it's BANK OPEN FAILURE and usually it means files cannot be read from the microSD card.

Now that you're getting more stable operation with the 5V supply, it's very helpful to use the serial monitor to verify proper boot, operation and look for errors. In the Arduino IDE go to Tools | Serial Monitor. 9600 baud is fine, and left of the Baud setting make sure Newline is selected. Also make sure you have the correct serial port selected ( Tools | Port, usually the correct port will say (Teensy) next to it. And be sure you USB is set to Serial (Tools | USB Type:). When you power up the Teensy with the USB cable connected, open the Serial Monitor and you should see lines of text printing out. You can also enter commands to test many functions.

The Troubleshooting page is full of good info - Teensy Saber Troubleshooting

Also, many topics like this have been discussed before so search back through this thread. For instance, a search for BANK turned up some good info.
 

Yeah, it's the BANK OPEN FAILURE. I tested 3 different microSD cards in different formats (FAT16, FAT32) with no luck.

My initialization in serial monitor:

Welcome to TeensySaber, type 'help' for more info.
Accel setup ...  Done
Gyro setup ...  Done
Amplifier off.
OPEN.WAV 233516
CLOSE.WAV 266284
FONT01 16384
FONT02 16384
FONT03 16384
FONT04 16384
HUM.WAV 21757996
CHARGING 16384
Done listing files.
Battery voltage: 4.82
Playing hum.wav
File hum.wav not found. ???

I got serial, port (teensy), 9600baud, newline "enabled".

I checked the troubleshoot page many times now but there seems to still be an error with SD card reading :(


Offline miib123

  • No Force
  • *
  • Posts: 20
  • Um...Hello?
Re: TeensySaber Software Discussion
« Reply #248 on: February 05, 2018, 09:40:42 AM »

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: TeensySaber Software Discussion
« Reply #249 on: February 05, 2018, 10:26:49 AM »
Oh and i almost forgot. Every time, teensy boots up, speaker speaks out the words sounding like "BAD OPEN FAILURE" or "BATCH OPEN FAILURE".
Pretty sure it's BANK OPEN FAILURE and usually it means files cannot be read from the microSD card.

Now that you're getting more stable operation with the 5V supply, it's very helpful to use the serial monitor to verify proper boot, operation and look for errors. In the Arduino IDE go to Tools | Serial Monitor. 9600 baud is fine, and left of the Baud setting make sure Newline is selected. Also make sure you have the correct serial port selected ( Tools | Port, usually the correct port will say (Teensy) next to it. And be sure you USB is set to Serial (Tools | USB Type:). When you power up the Teensy with the USB cable connected, open the Serial Monitor and you should see lines of text printing out. You can also enter commands to test many functions.

The Troubleshooting page is full of good info - Teensy Saber Troubleshooting

Also, many topics like this have been discussed before so search back through this thread. For instance, a search for BANK turned up some good info.
 

Yeah, it's the BANK OPEN FAILURE. I tested 3 different microSD cards in different formats (FAT16, FAT32) with no luck.

My initialization in serial monitor:

Welcome to TeensySaber, type 'help' for more info.
Accel setup ...  Done
Gyro setup ...  Done
Amplifier off.
OPEN.WAV 233516
CLOSE.WAV 266284
FONT01 16384
FONT02 16384
FONT03 16384
FONT04 16384
HUM.WAV 21757996
CHARGING 16384
Done listing files.
Battery voltage: 4.82
Playing hum.wav
File hum.wav not found. ???

I got serial, port (teensy), 9600baud, newline "enabled".

I checked the troubleshoot page many times now but there seems to still be an error with SD card reading :(

"BANK OPEN FAILURE" means that it can't find the files.
If it can't read the sd card at all, it will say "Please insert SD unit".
I suspect the problem is simply that the configuration file says to look for a diectory called "fontdir", but the directory on the sd card is called "font01".  Either rename the directory, or update the configuration.

You can also try to type "play font01/hum.wav" in the serial monitor, to just play a single file directly.

Offline miib123

  • No Force
  • *
  • Posts: 20
  • Um...Hello?
Re: TeensySaber Software Discussion
« Reply #250 on: February 05, 2018, 10:59:06 AM »
I can't play the files through serial. When i type "play something.WAV" it just fail to play (see picture above).

This is how my folders look like:

SD:


Inside tracks folder:


Common_presets.h:


v1_config: (do need to change pin presets?):


Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: TeensySaber Software Discussion
« Reply #251 on: February 05, 2018, 11:02:08 AM »
Dir command works like a charm but i stil cannot play any of the wav files (made them with audacity).

Have you tried just typing: play font01/hum.wav or similar?
You didn't save the wav files in a compressed or floating-point format I hope, because teensysaber only supports
PCM files. The playback speed must be 11025, 22050 or 44100Hz, and it should preferably have 16 bits per sample.

Quote
About SDcard... I've tried two 1gb microSD cards, which performs great with my mobile phone, USB reader, etc. I formated them in FAT16 format with SDformatter. I tried even two microSD card readers but the same problem persist. I used AWG26 wires for connecting SDcard adapter. Lenght is about 90mm. As a electrician, my soldering skills are pretty good too.

90mm may be too long. But maybe not since you can list files.
(At a few Mhz, the capacitance of even fairly short wires can become a problem.)
If you get hangs while playing sounds, try making the wires shorter.

Quote
I tried to use the serialflash method but honestly don't know how to upload the files onto chip :S

Easiest way is to use MTP, at least if you're on windows.
You just need to compile teensysaber with the usb type set to MTP.
If you're on a mac, you'll need to install MTP support, which I think comes from the android SDK.


Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: TeensySaber Software Discussion
« Reply #252 on: February 05, 2018, 11:10:03 AM »
I can't play the files through serial. When i type "play something.WAV" it just fail to play (see picture above).

Does it say why?
Does it crash/lock the teensy?
What actually happens?

Quote
This is how my folders look like:

The folder structure looks a little odd, this is how it would normally look:

font01/
font01/hum.wav
font01/swing.wav
font01/...all the other sound effects
font02/hum.wav
font02/swing.wav
font02/....
tracks/darth.wav
tracks/mars.wav
tracks/dubstep.wav

The directories can be called anything you like, as long as they match what you have in the config file, but the general idea is to have one directory per font, and one for background soundtracks. (I like the imperial march for that.)

Quote
v1_config: (do need to change pin presets?):

Not unless you hooked things up differently from what I did.

Offline KanyonKris

  • Padawan Learner
  • **
  • Posts: 72
  • Um...Hello?
Re: TeensySaber Software Discussion
« Reply #253 on: February 05, 2018, 12:20:27 PM »
Try putting some known good WAV files on your microSD card and playing them. For example, try these made-from-scratch sounds - SmoothSwing V2 Font Creators' Discussion Thread | The Rebel Armory
I used these files and I can confirm they play just fine.

Offline KanyonKris

  • Padawan Learner
  • **
  • Posts: 72
  • Um...Hello?
Re: TeensySaber Software Discussion
« Reply #254 on: February 05, 2018, 05:02:38 PM »
I'd like to be able to move through the available presets more easily to select the one I want. Right now this is done by holding down the power button when the blade is off and hitting the saber (like a clash) which is a bit cumbersome and slow.

I wonder if this would work: hold down the power button for 2-3 seconds to enter preset selection mode (perhaps acknowledged with a beep and/or the blade blinks) then slowly swinging the blade right causes the next preset to be selected after rotating 10-15 degrees, which is confirmed by a sound and the blade displaying that preset. Swinging left would go to the previous presets. Releasing the button selects the preset.

I've been looking at the code to see if I can do this now. Can I use the Longclick event and some code to check the Z axis rotation?

 

retrousse