[info] rusEFI console

It's all about the code!
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: dev console

Post by AndreyB »

Yes community edition
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
Ian
Posts: 13
Joined: Sat Jan 23, 2016 9:19 pm

Re: dev console

Post by Ian »

I am currently doing an SVN update from "https://svn.code.sf.net/p/rusefi/code/trunk"

If it helps.. :)
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: dev console

Post by AndreyB »

Btw console writes logs into 'out' folder. Can you please attach latest?
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
Ian
Posts: 13
Joined: Sat Jan 23, 2016 9:19 pm

Re: dev console

Post by Ian »

logs.. // from Console..

last one first.. and seems to be the largest.. 78K
Attachments
MAIN_rfi_report_2016-02-05 20_32.csv
(77.85 KiB) Downloaded 911 times
Ian
Posts: 13
Joined: Sat Jan 23, 2016 9:19 pm

Re: dev console

Post by Ian »

is 115200 the correct baud rate.. I noticed TS can change the baud rate ? just a thought..
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: dev console

Post by AndreyB »

No baud rate on this VCP, any values works the same.
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: dev console

Post by AndreyB »

@ has realized that the issue is Windows 10.
https://sourceforge.net/p/rusefi/tickets/264/
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
Ian
Posts: 13
Joined: Sat Jan 23, 2016 9:19 pm

Re: dev console

Post by Ian »

Loaded IntelliJ IDEA.. and ventured into JAVA for he first time.. having fun.. and learning.

what I have found is the Switch to Binary implementation "~ '\n" seems a little unreliable.

The snap shot below, seems to work on on my machine. but still not great..

what I have changed:
a. commented out close(); snip "if (isTimeout) { // close();" stops the exception error due the next port retry when the port is closed.
b. move the synchronized lock to further down, seems to allow the incomingData.waitForBytes(2, start, "switch to binary"); method access to the buffer, seems a resource lock issue. (possibly)
c. don't understand why it takes 15 attempts to switch to binary mode. changed it to three, seems to work on the second attempt.

still get lots of "Unexpected pending data: 1 byte(s)" ...
but a the gauges are now live..

Code: Select all

    public void switchToBinaryProtocol() {
        // we do not have reliable implementation yet :(
        for (int i = 0; i < 3; i++)
            doSwitchToBinary();
    }

    private void doSwitchToBinary() {


        while (true) {
            try {
                dropPending();

                stream.write((SWITCH_TO_BINARY_COMMAND + "\n").getBytes());

                // needs a delay here !! to allow 2 bytes to arrive
                Thread.sleep(100);

                long start = System.currentTimeMillis();

                    boolean isTimeout = incomingData.waitForBytes(2, start, "switch to binary");
                    if (isTimeout) {
//                        close();
                        System.out.println("Timeout waiting for switch response");
                        return;
                    }
                synchronized (ioLock)      //MOVED FROM ABOVE
                {
                    int response = incomingData.getShort();
                     if (response != swap16(SWITCH_TO_BINARY_RESPONSE)) {
                        logger.error(String.format("Unexpected response [%x], re-trying", response));
                        continue;
                    }
                    logger.info("Switched to binary protocol");
                }
            } catch (IOException e) {
                close();
                FileLog.MAIN.logLine("exception: " + e);
                return;
            } catch (InterruptedException e) {
                throw new IllegalStateException(e);
            }
            break;
        }
    }
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: dev console

Post by AndreyB »

The whole switch to binary is in fact a mess, I wish I remembered why 15 times - but the painful part is that this ugly code always works on Windows 7. See also https://sourceforge.net/p/rusefi/tickets/262/

I've made some changes to the code last night - not sure if you've updated - and now it does connect sometimes, like 50% of the times - which is better then "never" before that - on Windows 10. I am not sure which change made the difference, nothing seems stable.
// needs a delay here !! to allow 2 bytes to arrive
Thread.sleep(100);
I believe that this is not needed since waitForBytes method does the waiting.

Also about moving the lock down - on the one hand again I am now not sure what role it serve (I am keeping promising myself writing more documentation) but I am not sure how moving it below would change anything - what other code do you think is keeping this lock?
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
Ian
Posts: 13
Joined: Sat Jan 23, 2016 9:19 pm

Re: dev console

Post by Ian »

I am thinking the synchronized (ioLock) stop the incomingdata thread from inserting new data in the buffer.

you can easily see when the dropPending is removed, first byte arrive, then second time around the loop 3 bytes arrive.

I agree the extra sleep(100) should never get used.

I will checkout your changes and try your code..

(welcome to Window 10... a little slower..)
User avatar
rus084
contributor
contributor
Posts: 678
Joined: Sun Dec 01, 2013 1:40 pm
Location: Russia , Stavropol

Re: dev console

Post by rus084 »

console works on Android via Linux Deploy but need load UI before port is opened (cpu is slow) . in theory it can be connected via serial usb, but i haven't usb otg .
[video][/video]

консоль работает на смартфоне через Linux deploy . это chroot окружение линукса , запускаемое под андроидом (программы используют ядро и драйвера андроида) . графику вывожу с помощью X server напрямик в драйвер дисплея , так достигается максимальная скорость работы (графика андроида приостанавливается чтобы не было конфликтов ) .

консоль очень долго грузится поскольку одновременно грузится UI и обрабатываются данные с порта .
по идее оно должно работать и через usb , но я не могу проверить так как у меня нет usb otgв смартфоне
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: dev console

Post by AndreyB »

Windows 10 should kind of work now - https://sourceforge.net/p/rusefi/tickets/264/

I am not excited about the fix- I do not know the root cause of the issue, I've just hacked around it - but it seems to work.
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
jaw.asl
Posts: 1
Joined: Fri Feb 24, 2017 5:46 am

Re: rusEfi console

Post by jaw.asl »

hello I bought rusefi and trying to link it with computer via micro usb cable but i am not able to connect it via com port. i have installed the drivers for stm 32 but still no connectivity with dev console as well as tunerstudio. i have tried every possible way which is mentioned in the forums. kindly can you help me out in connecting my rusefi to computer so that i can interact with it.
regards
jaw.asl
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: rusEfi console

Post by AndreyB »

What OS are you using? Please post a screen shot of your device manager. You need st virtual com port driver.

What exactly did you buy? There should also be another mini usb on the board which should be another com port
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
chaoschris
Posts: 13
Joined: Mon Dec 18, 2017 4:07 pm

Re: rusEfi console

Post by chaoschris »

Hello everybody and sorry for digging-out this old thread, but it was the last one i found to the subject rusEFI console.
Does the rusEFI console (firmware upload) really work with Windows 10 64 bit?
I was fiddling with my new MicroRusEFI 0.4.7 and never got the firmware upload working with it. Bootloader mode is working and all devices/drivers are fine in Windows. So i tried to upload the firmware with st-link V2 and this worked like a charm. Tunerstudio is going online and everything seems to work so far.
After this i was curious why the firmware upload isn't working in rusEFI console and the stm32 bootloader mode and gave it a try in STM32CubeProgrammer. And i was astonished the firmware upload was working on the first try (via USB and STM32 Bootloader mode).
Any idea what i'm doing wrong with the rusEFI console?
Best regards,
Chris
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: rusEfi console

Post by AndreyB »

Chris,

rusEfi console has a lot of different features and a lot of different use-cases. As is I am a bit confused about which exact use case you are referring two.

Please clearly write your sequence of actions, your expected results and your actual results. Sounds like something worked for you? Something did not work for you? I am not sure which is which.

Please maybe consider taking a screen video with either ShareX software or any other software or maybe even record you screen with your cellphone.
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
mck1117
running engine in first post
running engine in first post
Posts: 1493
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: rusEfi console

Post by mck1117 »

AndreyB wrote:
Wed Mar 04, 2020 3:01 pm
Please clearly write your sequence of actions, your expected results and your actual results. Sounds like something worked for you? Something did not work for you? I am not sure which is which.
I think there is actually a bug here - I think the newer STM32CubeProgrammer software installs a driver incompatible with the DFU utility we're bundling in the console. I think I've seen the same behavior.

@AndreyB: try installing this tool, and using the rusEfi console to update firmware: https://www.st.com/en/development-tools/stm32cubeprog.html
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: rusEfi console

Post by AndreyB »

Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
chaoschris
Posts: 13
Joined: Mon Dec 18, 2017 4:07 pm

Re: rusEfi console

Post by chaoschris »

mck1117 wrote:
Thu Mar 05, 2020 12:34 am
I think there is actually a bug here - I think the newer STM32CubeProgrammer software installs a driver incompatible with the DFU utility we're bundling in the console. I think I've seen the same behavior.
Just for clarification, I installed the STM32CubeProgrammer >after< the non-working firmware upload to mre, not before. It was a clean Win10 64 bit 1909 with all drivers and updates i made for this just to avoid such problems..... ;-)
Post Reply