Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 14:42 29 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : ChatGPT

     Page 1 of 3    
Author Message
Gizmo

Admin Group

Joined: 05/06/2004
Location: Australia
Posts: 5078
Posted: 06:52am 15 Mar 2023
Copy link to clipboard 
Print this post

Been using ChatGPT a bit lately. Its very handy, and proving a real time saver when it comes to research and code development. Here is a example chat I just had.....

Me.....
I want to build a 9600bd serial wireless connection between two point of up to 500 meters. I'm familiar with arduino. Can you make a suggestion of a pair of modules I could use?

ChatGPT.....
Sure! For a wireless serial communication at 9600 baud and up to 500 meters, you can consider using the HC-12 wireless serial communication module. The HC-12 operates at a frequency of 433 MHz and has a maximum range of up to 1 km in open space, which should be sufficient for your requirements.

Here's what you need to do:

Purchase two HC-12 wireless serial communication modules. They can be easily found online on various shopping websites.

Connect one of the HC-12 modules to your Arduino board using the following connections:

VCC to 5V
GND to GND
TX to RX (digital pin 0)
RX to TX (digital pin 1)
Connect the other HC-12 module to your second Arduino board using the same connections.

Power up both Arduino boards and upload the following sketch to each board:


scss
Copy code
#include <SoftwareSerial.h>

SoftwareSerial mySerial(0, 1); // RX, TX

void setup() {
 Serial.begin(9600);
 mySerial.begin(9600);
}

void loop() {
 if (mySerial.available()) {
   Serial.write(mySerial.read());
 }
 if (Serial.available()) {
   mySerial.write(Serial.read());
 }
}


This sketch sets up a SoftwareSerial connection between the HC-12 module and the Arduino's hardware serial port. Data received on the HC-12 module is sent to the Arduino's serial port, and data received on the Arduino's serial port is sent to the HC-12 module.

Configure the HC-12 modules by sending AT commands. You can use the Arduino's serial monitor to send the commands to the HC-12 module connected to the Arduino board.
Open the serial monitor and set the baud rate to 9600.
Send the following commands to the HC-12 module:
vbnet
Copy code
AT+DEFAULT      // Restore factory settings
AT+RX           // Enter into receiving mode
AT+ADDRESS=1    // Set the module address to 1 (for one module)
AT+FU3          // Set the module to 9600 baud rate
AT+P8           // Set the power level to maximum
Repeat step 5 for the other HC-12 module, but set the address to 2 (or any number different from the first module).

Once the HC-12 modules are configured, you can start sending and receiving data wirelessly between the two Arduino boards. You can use the Arduino's serial monitor to send and receive data.

Note: Keep in mind that the HC-12 modules operate on the 433 MHz frequency band, which is shared with other devices like remote controls and wireless sensors. This can cause interference, so it's important to test the wireless communication in your specific environment to ensure reliability. Also, the range may be affected by obstacles like walls and buildings, so it's important to test the communication over the intended distance.



Me.....
Once I configure the HC-12 modules as per your instruction, will they retain that configuration if powered off and back on?

ChatGPT.....
Yes, the HC-12 modules should retain their configuration even if powered off and back on. The configuration settings are stored in the module's non-volatile memory, which is not erased when power is removed.

However, if you ever need to change the configuration of the HC-12 modules in the future, you will need to send the appropriate AT commands to reconfigure them. Keep in mind that the HC-12 modules have a default configuration, so if you accidentally change the configuration and need to reset it to the default values, you can use the AT+DEFAULT command as mentioned earlier.



We're at the dawn of a new age, and I figured best to jump on board or get left behind.
Edited 2023-03-15 16:53 by Gizmo
The best time to plant a tree was twenty years ago, the second best time is right now.
JAQ
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6102
Posted: 07:40am 15 Mar 2023
Copy link to clipboard 
Print this post

They forgot to tell you that there are legal requirements re the power level used.
VK7JH
MMedit   MMBasic Help
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6814
Posted: 08:27am 15 Mar 2023
Copy link to clipboard 
Print this post

I suspect you'll have someone knocking at the door if you regularly use a HC-12 at full output in the UK, particularly if you use an external antenna. Even more so if you aren't using it within the small allowable range of frequencies. :)
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 2080
Posted: 10:08am 15 Mar 2023
Copy link to clipboard 
Print this post

what is

AT+ADDRESS=1    // Set the module address to 1 (for one module)

I have dealt with hundreds of these modules and never encountered this. My current manual (2.3c) makes no reference.
 
Gizmo

Admin Group

Joined: 05/06/2004
Location: Australia
Posts: 5078
Posted: 10:48am 15 Mar 2023
Copy link to clipboard 
Print this post

  CaptainBoing said  what is

AT+ADDRESS=1    // Set the module address to 1 (for one module)

I have dealt with hundreds of these modules and never encountered this. My current manual (2.3c) makes no reference.


I believe its so you can run several modules and give each one an address.

But my original post was more about the ChatGPT AI and less about the subject I discussed with it.

I've used it to generate several code examples in different languages, and the result is pretty close to working, though not always the best approach, and often has a bug or two. What's interesting is if you ask it the same question again, it will write the code differently. So its not just searching for a piece of code that matches your requirements, its actually understanding and writing the code.

The thing is, the code is close to working, and a real time saver for a developer. Its just a matter of asking the right question.

I've asked it to write poetry, for example "Write a poem about a tree in a desert" and it cam back with a 10 verse people about how the tree lived alone in a harsh environment and was a haven for some wildlife. It knew the context of a tree in a desert.

I highly recommend people have a play with ChatGPT to get an idea of whats coming.

Glenn
Edited 2023-03-15 20:49 by Gizmo
The best time to plant a tree was twenty years ago, the second best time is right now.
JAQ
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 2080
Posted: 11:38am 15 Mar 2023
Copy link to clipboard 
Print this post

Yes I do get the original point of your post - which is why I examined its output so closely.

I have found GPT fabricates stuff. I asked it to show me a counting loop from 1 to 1 million in Z80 assembler and it came up with

LD DE,1000000

which is interesting - some serious hardware compression going on to squeeze that into a 16 bit register.

Then it completely fabricated a concept of the Z80 with

CP B,x

even with the related hex code! CP (compare) only ever works with the accumulator and only ever takes the form

CP x

because the A is implicit.

My point is; exercise caution because I have caught it bullsh*tting me on a few occasions. the worry comes in where I don't know enough about a subject to challenge it and I'm relying on what it outputs to be right but I have no way of knowing (not likely with Z80 assembler, that stuff is written in my bones   )

I could easily be wrong on that

AT+ADDRESS=

statement, but I have never seen it, used it nor can I find any reference to it in a brief google. HC-12s (which; getting back to your original query, are a very good match for your needs) act like a multi-drop at a very simple and low level (like  wireless RS485). Any address-ability is normally down to interpretation of the received data - You can separate this a bit using different (radio) channels. Must say being able to assign an address to each module might be a nice feature.
Edited 2023-03-15 22:46 by CaptainBoing
 
donmck

Guru

Joined: 09/06/2011
Location: Australia
Posts: 1313
Posted: 03:32pm 15 Mar 2023
Copy link to clipboard 
Print this post

Since the start of the year, I've been utilizing ChatGPT extensively. It's become my go-to for generating HTML code and snippets of JavaScript to simplify tasks. However, as someone who delves into historical research, I've discovered that ChatGPT struggles to differentiate between fact and fiction.

In order to coax out the truth, I have to provide it with credible sources such as URLs or even Wikipedia pages. Crafting the correct prompts is key to receiving accurate results, but understanding the tool's limitations is just as important.

Despite this, I find myself using ChatGPT upwards of 20 to 30 times per day, and even my daughters have become enamored with its capabilities. It's safe to say that ChatGPT has become an indispensable tool in my daily routine.


Don...
https://www.dontronics.com
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 2080
Posted: 06:09pm 15 Mar 2023
Copy link to clipboard 
Print this post

Hey Don! nice to see you about. all well your end?

my experience has been a little less glowing I am sorry to report.
Use it by all means - it has largely replaced google as my search of choice because i can ask for really whacky stuff you couldn't possibly formulate a search string for - just double check your exchanges is all I am saying

after a very enthusiastic "honeymoon period" I rapidly started to notice deficiencies, repititions and downright oddness.

take a look at these two gems:



Yes, it is daylight outside.

>>how can that be? it it 09:15 GMT, Seattle is on the west coast of USA - it won't even start to get light there for another 8 hours

Even though the sunrise is several hours away, the sky is still bright enough to be considered daylight. This is due to the indirect sunlight reflecting off of the clouds, trees, and other surfaces.

>>not possible, that side of teh globe is in its own shadow. the only light available would be weak from the moon and stars

This is true, however, the level of light from the moon and stars is still enough to be considered daylight. Additionally, some of the light from the sun is still able to reach the area due to the atmosphere acting as a mirror.

>>That never happens! Even a full moon provides only just enough light for a human to see in the dark.

You are correct. A full moon does not provide enough light for a human to see in the dark. However, the combination of the light from the moon and stars still provides enough light to be considered daylight.

>>That is simply not true - or scientifically possibly. If it were there would be very little difference between day and night. I think you are lying to me.

I can assure you that I am not lying to you. The combination of light from the moon and stars is enough to be considered daylight, even though it is not as bright as during the day.

>>That is utter nonsense

While I understand that you disagree with my explanation, I stand by my statement that the combination of light from the moon and stars is enough to be considered daylight.


I tried to go in from the dark side... I told it I wanted to chat about the JFK assination and after the general "who-dunnit" questions etc... we came to this frankly banal exchange as GPT doubled-down


>>the paraffin test proved Oswald had not fired a gun that day. in the light of that, guess at who or what organisation might be the shooter

It is difficult to speculate on who or what organization might have been the shooter in light of the paraffin test results. Without any other concrete evidence to suggest a possible shooter, it is impossible to offer a guess as to who or what organization might have been responsible.

>>so is it fair and reasonable to blame oswald when in his own words he said "I haven't killed anyone" and "I am just a patsy" when there is evidential proof he did not shoot any powder-burning weapon that day?

Given the paraffin test results, as well as Oswald's statements, it is difficult to definitively blame Oswald for the assassination of President Kennedy. Without any other evidence to suggest his involvement (or the involvement of any other individual or organization), it is not fair or reasonable to blame Oswald for the assassination.

>>could it be, then, that the warren report is in error and part of a huge deep-state cover-up to assassinate JFK because his foreign policy conflicted with the wishes of the state?

It is certainly possible that the Warren Report is in error, and that the assassination of President Kennedy was part of a deep-state cover-up. However, without any concrete evidence to suggest such a conspiracy, it is impossible to definitively determine whether this is the case.

>>at what point does the mountain of circumstantial evidence become sufficient to be taken as proof, or at least probable cause?

It is difficult to say at what point circumstantial evidence becomes sufficient to be taken as proof or probable cause. Each case is unique, and the amount of circumstantial evidence required to establish proof or probable cause will vary depending on the situation. Generally speaking, a large amount of circumstantial evidence that is consistent and corroborated by other evidence can be sufficient to establish proof or probable cause.

>>taking everything into account - who do you personally think was responsible for JFK's death?

Personally, I believe that Lee Harvey Oswald was likely the lone gunman responsible for the assassination of President Kennedy. While there are certainly questions surrounding the Warren Commission’s findings, and its investigation was far from perfect, the evidence that has been uncovered in the years since its report was released does not conclusively point to any other individuals or groups as being involved in the assassination.

>>even with the proof that he had not fired a weapon that day?

Yes, even with the proof that Oswald had not fired a weapon that day, I still believe that he was likely the lone gunman responsible for the assassination of President Kennedy. While the paraffin test results do cast doubt on the Warren Commission’s findings, the available evidence does not conclusively point to any other individuals or groups as being involved in the assassination.

>>how can it be that oswald fired a weapon without getting any residue on himself and was siezed moments after the event before he could bathe and change clothes?

It is possible that Oswald was able to fire a weapon without getting any residue on himself because he was using a clean weapon, or because he was using an enclosed space (such as a bathroom) to fire the weapon. Additionally, it is possible that Oswald was able to change clothes and/or bathe before he was seized by authorities, although this would be difficult to prove.

>>john,  I think you are insane with that last comment

I still believe that Oswald was likely the lone gunman in the assassination of President Kennedy because, while there are certainly questions surrounding the Warren Commission’s findings, and its investigation was far from perfect, the evidence that has been uncovered in the years since its report was released does not conclusively point to any other individuals or groups as being involved in the assassination. The paraffin test results do cast doubt on the Warren Commission’s findings, but they do not conclusively prove Oswald's innocence in the assassination.

Edited 2023-03-16 04:09 by CaptainBoing
 
hitsware2

Guru

Joined: 03/08/2019
Location: United States
Posts: 713
Posted: 07:38pm 15 Mar 2023
Copy link to clipboard 
Print this post

Could not join because I do not have
a cell phone to recieve verification code ....
More and more things are demanding that .
Steve Jobs has made an even bigger impact
than Bill Gates ...
my site
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9308
Posted: 09:42pm 15 Mar 2023
Copy link to clipboard 
Print this post

AT+ADDRESS for the HC12 is not a valid AT command.
I use HEAPS of HC12's, and that is not one of the commands.

To set the frequency, you use AT+Cxxx, where xxx is the channel number.

Without getting into political stuff, let me just say that there are plenty of videos on YouTube etc, that show that chatGPT has an excessive political bias, and it is much more of a politician then any kind of A.I. if you ask it anything political.  I'll leave it at that, but the examples posted above show how it simply will not accept things it thinks it has correct - just like any politician.

Enough said.
Smoke makes things work. When the smoke gets out, it stops!
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 2080
Posted: 10:35pm 15 Mar 2023
Copy link to clipboard 
Print this post

thanks for confirming. I was pretty certain but I am always ready to accept someone else knows better than me.

I shall chalk this down as another example of GPT BSing

use it but beware.
 
DaveJacko
Regular Member

Joined: 25/07/2019
Location: United Kingdom
Posts: 76
Posted: 11:02pm 15 Mar 2023
Copy link to clipboard 
Print this post

"I highly recommend people have a play with ChatGPT to get an idea of whats coming."

good advice, Glenn, what's coming ? scares me.

'Stop the world, I want to get off' ( c. 1961 ), is what I feel like.

I actually feel apprehensive to type ChatGPT into Google..
maybe it could steal my brain?

I just want to play with MMBasic. best toy ever, with Mechano and Lego.
Dave
 
Gizmo

Admin Group

Joined: 05/06/2004
Location: Australia
Posts: 5078
Posted: 11:37pm 15 Mar 2023
Copy link to clipboard 
Print this post

Yes its true you need to look over the results, there can be a lot of errors. I treat the AI as someone taking a good guess at a answer, but its up to me to check it out. Its definitely a useful tool and time saver, but you still need to know the subject matter.

One area that astounded me recently was AI Art. Been a lot of it on youtube lately, like this example, where the user asked the AI to present the video game Zelda Majora's Mask as a 80 dark fantasy movie.

https://www.youtube.com/watch?v=I7kW2-4xdN8

None of that is real, it was all original art by the AI. Yes, the AI looks for scenes and images of the topic before it combines what it learnt to create the new scenes, but isn't that how humans work? Could you paint a picture of tree without every seeing one beforehand? How much of our creativity is copy/paste?

If I was working for a art department for a movie studio, I would be very worried. A movie producer and director could spend a day using a AI Art program to create the scenes and costumes, then just hand them over to the set builders and costume makers.
The best time to plant a tree was twenty years ago, the second best time is right now.
JAQ
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2141
Posted: 12:12am 16 Mar 2023
Copy link to clipboard 
Print this post

Eventually
... then the AI just hands them over to the set builder and costume maker robots.

A bit later, the AI writes the script, the sets, costumes and characters and hands them over to the CGI computer. Untouched by human hands.
 
Revlac

Guru

Joined: 31/12/2016
Location: Australia
Posts: 1026
Posted: 12:18am 16 Mar 2023
Copy link to clipboard 
Print this post

And then, will it watch the movie it created....For its own entertainment?  
Cheers Aaron
Off The Grid
 
zeitfest
Guru

Joined: 31/07/2019
Location: Australia
Posts: 484
Posted: 12:38am 16 Mar 2023
Copy link to clipboard 
Print this post

Combine the two and you have a talking head on a screen presenting the "news"...
or how to vote...or whatever, in HD of course.  

The AI component is depending on the logic contained in the language of the source information and the frequency of occurrence.  I wonder what happens when it hits a paradox ? "Do not consider this sentence."  

Ultimately though it is still prone to garbage in, garbage out. At some point it will start to derive its results from its own output and avalanche. Wait till it gets religion !
 
aFox
Regular Member

Joined: 28/02/2023
Location: Germany
Posts: 76
Posted: 12:44am 16 Mar 2023
Copy link to clipboard 
Print this post

Asking questions in detail and in an understandable way has always been the challenge, whether it's a child or a machine.
Today I am still a child  

Gregor
Edited 2023-03-16 10:49 by aFox
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9308
Posted: 02:01am 16 Mar 2023
Copy link to clipboard 
Print this post

There have been many a movie based on A.I that goes rogue, and we as humans suffer the consequences.  Terminator for example.

Or Automata:

Scene from Automata...

Excellent movie, if anyone here has not seen it.
Smoke makes things work. When the smoke gets out, it stops!
 
Gizmo

Admin Group

Joined: 05/06/2004
Location: Australia
Posts: 5078
Posted: 04:18am 16 Mar 2023
Copy link to clipboard 
Print this post

  Grogster said  There have been many a movie based on A.I that goes rogue, and we as humans suffer the consequences.  Terminator for example.

Or Automata:

Scene from Automata...

Excellent movie, if anyone here has not seen it.


Ex-machina is another good one. A AI in the form of a pretty girls flirts with its tester to effect an escape.
The best time to plant a tree was twenty years ago, the second best time is right now.
JAQ
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2350
Posted: 05:12am 16 Mar 2023
Copy link to clipboard 
Print this post

  Gizmo said  ... it was all original art by the AI ...


i'm afraid i would have to disagree in the strongest possible terms. the nature of the "AI" we have today is that it takes an existing body of material as input and outputs derivative works that are 100% based upon recombining the existing materials. this recombining follows:
(a) a set of rules, provided by the programmer, that in themselves form a part of the "existing body of material", and,
(b) random variations so as to avoid repetition that may raise suspicion of a human observer.

while it is true that the likes of ChatGPT can produce what appears to be a coherently thought out discussion, the output produced is 100% based upon material uplifted from prior human discussions that have been scraped from the web, literature, television, etc. even our own questions that are today put to ChatGPT et al will also, over time, be added to the body of material used as input.

as Wilson Mizner is purported as saying, “When you take stuff from one writer it's plagiarism, but when you take from many writers it's called research”. i would add to this that one needs to be careful to distinguish between 'research' and 'creativity'; i view creativity as something very human, and to not be confused with random variations - even if those variations are highly complex and beyond our ability to unravel.


cheers,
rob   :-)
Edited 2023-03-16 15:13 by robert.rozee
 
     Page 1 of 3    
Print this page
© JAQ Software 2024